## Using the Inverse Hyperbolic Sine

Image processing is both an art and a science, in equal measure, and I never cease to be amazed at the skill of the few people who are able to master it.

One tool in the ever-expanding workshop is the inverse hyperbolic sine, also known as the hyperbolic arcsine. Its use for image processing was described twenty years ago by Robert Lupton et al. (2003) in a paper entitled “Preparing Red-Green-Blue (RGB) Images from CCD Data.” In the abstract, the authors write:

We also introduce the use of an asinh stretch, which allows us to show faint objects while simultaneously preserving the structure of brighter objects in the field, such as the spiral arms of large galaxies.

Before we can know what a hyperbolic arcsine (asinh) is, we need to understand what a hyperbolic sine is. Just as a circle can be drawn out by the set of coordinates (x,y) = (cos θ, sin θ), the right half of an equilateral hyperbola (also known as a rectangular hyperbola) can be drawn using (x,y) = (cosh θ, sinh θ) where cosh is the hyperbolic cosine, and sinh is the hyperbolic sine. Just as the arcsine is the inverse sine function, i.e. if y = sin x, then x = asin y (also written as x = sin-1 y), so, too, the hyperbolic arcsine is the inverse hyperbolic sine function, i.e. if y = sinh x, then x = asinh y (or x = sinh-1 y).

If we consider the light intensity recorded by a pixel (say, a number between 0 and 65,536, where 0 is the darkest value and 65,536 the brightest) to be x, and then x′ to be the value of that pixel after passing through the hyperbolic arcsine function, we can map pixels using the following equation: $x'=sinh^{-1}\left ( \frac{x}{\beta } \right )=ln \left ( \frac{x+\sqrt{x^{2}+\beta ^{2}}}{\beta } \right )$

where β is called the “softening parameter”, something you can tweak to bring out desired details.

If you play with this equation a little bit, you’ll quickly see that the smallest values of x (representing the darkest parts of your image) are pretty much left alone, but large values of x (representing the brightest parts of your image) are transformed to much smaller numbers. This then allows you to bring out the fainter details in your image without completely saturating the brighter parts of your image, since whether displayed on a monitor or the printed page, you have a limited dynamic range that can be rendered. Here is an example of an image that has benefited from a hyperbolic arcsine stretch.1

M17 with linear display (left) and after asinh stretching (right)