Plugin: JS9Blend

### JS9 Image Blending

The Image Blending plugin allows you to combine selected images using a specified blend mode and optional opacity. Blend modes are different ways in which the colors of individual pixels are combined between a source and background image. For example, the multiply mode multiplies the color value of the source pixel by the color value of the background pixel and uses the resulting (scaled) value for the color:

        x = a * b

Multiplying white (value 1) by any other color results in the latter color being used. Multiplying black (value 0) by any other color results in black being used. Thus, multiply makes whites transparent but otherwise darkens the image.

One of the most useful blend modes for astronomy is screen, which is the opposite of multiply: white pixels are made opaque, black pixels become transparent, and other pixels are lightened. The blend algorithm multiplies inverses and takes the inverse of the result:

        x = 1 − ((1 − a) × (1 − b))

Standard blend modes supported by modern Web browsers are documented in W3C Compositing and Blending, which includes algorithms and examples for each mode.

The Image Blending plugin allows you to toggle global image blending on and off, so that you can switch between blending and the ordinary display of a single image. By default, when the plugin is displayed, blending is turned on.

Each image loaded into the display will be shown in a stack. The currently active image will be displayed with a green border. This is the image that responds to contrast/bias changes, region creation, etc. It also is the image on which browser-based analysis and server-based analysis is performed. You can click on any image in the stack to make it the current image.

If you have two or more observations of the same object displayed, you probably will want to align them by WCS coordinates. This can be done by utilizing the WCS->reproject menu option, which uses the WCS of one image to reproject the other into a new raw data layer.

Once two or more images are aligned, you can change the colormap, contrast/bias and scaling of each of them separately and then combine them into a single display. This is done by clicking the blend using button to add this image to the blend list, and the choosing its blend mode and optional opacity. You can continue to change the colormap, scale, contrast/bias, etc. of the current image even after blending has been turned on.

Note that some, but not all, blend modes are commutative. In particular, the non-separable blend modes (hue, saturation, color, and luminosity) are all order-dependent. In such cases, you can change the stacking order simply by dragging an image into the appropriate place on the stack.