HistogramTransformation is probably the most used tool to stretch an image into its nonlinear state because it is easy to use when used in conjunction with the ScreenTransferFunction (STF).

You can use HistogramTransformation more than once and can use it with both linear and nonlinear images. You typically use HT after you have completed linear processing like DBE, BackgroundNeutralization, and ColorCaluibration for color images.

An Overview Of The HistogramTransformation Interface

When you open HistogramTransformation, you will see an interface like the following:

  • The top window is the output graph of what the histogram will look like after applying the transformation
  • The bottom graph is the input graph you use to edit the transformation
  • The Input Horizontal Zoom allows you to zoom in and out on the input graph
  • The midtones slider is used to stretch the image
  • The View Selector allows you to select the view HT is processing
  • The Real-Time Preview is at the bottom-left of the window
  • The Reset button is at the bottom-right of the window

You manipulate the stretch by moving the midtones slider to the left to stretch your image. You can enable the real-time preview for immediate feedback, although you’ll have to reset your STF when you do that because you don’t want both the STF and HT stretch active at the same time.

Using HT With STF

A quick way of determining a good starting point for a stretch is to use the ScreenTransferFunction (STF). The STF applies a temporary stretch to your image but we can use that as the basis for a stretch with HT.

Here’s how to use the STF with HT:

  1. Open the STF and click the Track View button (the checkmark icon)
  2. Select your image to make it active
  3. Click the yellow and black icon in the SFT (the Auto Stretch button)
  4. Open HistogramTransformation
  5. Drag the New Instance icon from the STF to the bottom bar of HistogramTransformation as shown:
  • Reset your STF (click the Reset button at the bottom-right of the STF window)
  • Open the HT Real-Time Preview (RTP)
  • Edit the HT as required

While the STF-stretched of your image might be good, there are times when you can improve on the result. The following section provides you with a starting point to edit the histogram.

Editing the HistogramTransformation

The STF probably placed the midtones slider very close to the black point, on the left of the histogram as shown in the input graph.

Do the following to edit the histogram stretch:

  1. Select your image in the View Selector (see the first screenshot for the location)
  2. Zoom into the graph by increasing the number in the area circled in red in the following preceding screenshot
  3. Zoom in to the point where you can see the individual sliders as shown in the preceding screenshot
  4. Move the black point slider to the toe of the input graph as shown in the preceding screenshot (you may not have to move the slider because it may already be there)
  5. Move the midtones slider until the area where white point meets the baseline on the output graph is between the two circled lines shown on the output graph in the preceding screenshot
  6. Close the RTP
  7. Drag the New Instance icon (the triangle icon) from the HT window to your image to execute the stretch and make your change permanent
  8. Reset the HT window so that the upper part of the graph is correct (otherwise it shows what the graph would look like when the HT is applied twice)

Moving the white point, on the far right of the input graph is not a recommended way of stretching an image, except in cases where you wish to create a high contrast image to use as a mask.

Conclusion

In this article, you learned about HistogramTransformation and learned how to use it to stretch an image into its nonlinear state.

More Articles In This Series

This article is part of a whole series of articles about processing images using PixInsight: