Stretching Tutorial

Although the Screen Stretch window allows you to adjust the brightness and contrast of the image on the screen, sometimes you want to change the data in the image buffer. For example, you might want to adjust an image so it will fit in the 8-bit range of a JPEG file. You might also want to try a "non-linear stretch" to compress the dynamic range of the image. These operations are performed with the Stretch command.

If you have not already done so, open the DG_HaleBopp.fits file in the Samples directory. (For help on opening files see the Open a File Tutorial).

Press the Stretch button on the Toolbar to bring up the Stretch dialog.

Set Permanent Stretch Type to Log, Input Range to Manual Settings, and Output Range to 16 bit (0 - 64K). Turn on Auto Preview. As you can see in the Preview Image, these settings will dramatically compress the dynamic range of the image so that the brightest and faintest parts of the comet are both visible at once.

Perhaps this setting is a bit harsh. We can better control the amount of dynamic range compression by changing the Permanent Stretch Type to Gamma. Set Gamma Value to 0.2 and click OK.

Now set the screen stretch to Low using the Screen Stretch window. You can toggle back and forth between the processed and original version of the image using the Undo and Redo buttons on the Toolbar. Notice how the faint outer details in the comet are enhanced, but the brighter details are still visible.

Various effects can be achieved with the Stretch command; the following are some suggestions you can try:

At this point, some additional explanation of the Preview Image is in order. You will notice that the Screen Stretch window is still available; if it is not on, you can turn it on using the button on the Toolbar. Which image the Screen Stretch window affects is determined by the state of the Auto (Preview) push button and by where the focus is, that is, on which window you last clicked. If Auto is off, both the image buffer and the Preview Image always adjust together. If Auto is on, the Preview Image actually becomes a different image and is separately adjustable. When you start a command dialog, or after clicking on it, the Preview Image has the focus and is therefore adjusted. If you click on the main image window or its title bar, it gets the focus and the Screen Stretch window will now adjust it instead. To adjust the Preview Image again, click anywhere on the dialog box.

You can also preview the result of the processing on the Full Screen. Refer to the documentation of the Preview Image in the Command Reference for details of Full Screen previewing.