Introduction

In the previous steps in processing we have kept the scientific information in the image essentially intact.  The files that were written out to the RAW format are deep 16 bit files and captures something of the dynamic range of the object.  However these images are not very satisfactory to view.  There is information hidden in the bottom few percent range of the image. For example, in the image of M83, the galaxy arms have brightness values around 4300, against background levels of 3700.  The maximum value in the image is 19300, so there is much interesting information in the bottom 4% of the image.

The process described below aims to transform the dynamic range of the image so that details, both in the galaxy arms and the bright region around the core are visible.  This is known as contrast or histogram stretching.  There are several ways of doing this.  The log transform in Iris is one way - that has the advantage of being repeatable and can be consistently applied to different images, or different colour channels.  However this has the disadvantage of applying a drastic stretch, particularly to the fainter parts of the image and tends to emphasise low level noise.

I use the adjustment of Curves in Photoshop to do histogram stretching.  This lets me control better the contrast of the image, the noise, and lets me stop bright stars bloating.  However the process is not very repeatable.  In order to maintain the relationship between colour channels as far as possible throughout the stretching process, these transforms should be done on all these as the same time, which is the reason for reading in the combined 16 bit RGB image.

 

Reading the images into Photoshop

First open the Y image.  In Photoshop do File, Open.  The Raw Options box opens.  Note that the dimensions of the image has to be specified.  The Y image has only 1 channel and the file is 16 bits with IBM PC byte order.  When the file was exported from Iris, we specified that the header size would be 0.

Here's what the image y.raw looks like when first opened.  Note that it is quite dark and that it's flipped vertically.  Do Image - Rotate Canvas - Flip canvas vertical. 

 

 

 

 

 

 

 

 

 

 

The image histogram shows why it is so dark.  The values are bunched up towards the bottom of the range.   At this point I used to slide the white point slider (the right one) to the left to the highest tone values, but I have since found that this is unnecessary and in fact produces washed out highlights.

Histogram Stretching

To do histogram stretching, do Image - Adjustments - Curves...  The curve will be straight to start with, but grab a point on the lower left of the line and pull it up.  Let's call this a Positive Curve Stretch.  The fainter parts of the image will start to appear.

 

 

The same curve adjustment is repeated.  More of the arms now appear.  The histogram now shows better use of the dynamic range with the bright stars approaching saturation.  Any more stretching and these stars will start to bloat.  The next step aims to control this.

Preventing bright star bloat

Now select the brightest stars by drawing, with the Elliptical Marquee Tool, small circles around them.  Make sure that Feather is set to 2 pixels.  Do Select - Inverse.  See the image below left.  Now all further operations will not apply to these stars.  Another curve stretch results in the image on the right.  The background is now too bright, and there are darl halos around the selected stars because their development has been held back. 

 

 

 

 

 

 

 

 

 

 

 

A look at the histogram shows that the high end of the dynamic range  is well used, but the low end is too bright.  Now the background of the image needs to be reduced in level.  This could be done by simply grabbing the black point slider and moving it to the right to where the graph starts to climb.  However this tends to emphasise low level noise.  I prefer to do the reverse of the curve manipulations before to quieten the background.

Quieten the background

The following curve, which I will call a Negative Curve Stretch, done twice over, gives this new image.  The fainter parts of the galaxy are now visible while the details are maintained in the highlights.

 

The histogram confirms a good use of the dynamic range.  Compare this with the previous histograms.  The spikes in the low part of the dynamic range have been reduced.  The bright parts of the image now extend all the way to the top of the dynamic range, without any clipping, which would have been indicated by a spike at the very right of the histogram.  However the background is still too light, and the histogram should probably be stretched some more.

Negative, Positive, Negative Curve Stretches in that order gives the following image and histogram.

 

This is now close to the desired result.  Notice that the histogram is still smooth, after all that manipulation!  This would not have been possible with an 8 bit image.

The next step is to match the bright stars back to the rest of the image.  In the image above they have bright halos, which will need to be corrected.  As the previous transforms acted on the whole image except the stars, I now invert the selection, Select - Inverse. Then Feather the selection to 2 pixels to smoothen the effect.  Here's a closer view of the stars in the image above, the subsequent Curve, and the result (de-selected for clarity).

The stars are now smaller but there is still a bit of a bright halo.  At this point I examine other selected stars that might have a brighter background, such as those embedded in the galaxy arms, and de-select them (using the Lasso tool set to "Subtract from Selection") if they look fine against the background.  For the stars with the darker background, some further adjustment is necessary.   The final Curve transform on the stars and the result are shown below.  Look at that bright star near the top right corner.  It was not selected because I expected it to be cropped out in the final image.  Notice how large it is.  The other bright stars would have looked like that if they had not been held back.   The stars are still not perfect, but a slight halo actually helps to show star colours, and there will be opportunities to do further adjustments in the next stages of processing.  Unsharp masking may be done at this stage to enhance detail.

Next:  Noise Reduction, and Colour

(Part 1, Introduction)  (Part 2, Aligning and Stacking in Iris) (Advanced Processing)

© Copyright 2003, 2004, 2005 by TG Tan.  All rights reserved.  Copyright exists in all original material available on this website.  This material is for your personal individual, nonprofit use only.  Redistribution and/or public reproduction of this material is strictly prohibited without prior express written permission from the author.