APLpy uses a different set of normalization techniques than other image
display tools. The default options available for the `stretch` argument are
`linear`, `sqrt`, `power`, `log`, and `arcsinh`.

In all cases, the transformations below map the values from the image onto a scale from 0 to 1 which then corresponds to the endpoints of the colormap being used.

APLpy defines the log scale with a `vmid` parameter such that

where:

and:

and is the image pixel values. Note that should be smaller than , which means that will always be larger than one. By default, and is therefore required to be positive (but negative values of are allowed if is specified).

For reference, in the FITS display program ds9, the log scale is defined by

where defaults to 1000 and recommended values are from 100-10000 (see here).

The two stretches are *nearly* (but not completely) identical for . If you want to convert from the ds9 parameter to
APLpy’s , you can use this formula:

The arcsinh scale is defined by

where

By default, is chosen such that .

For reference, the ds9 definition is simply