Home Page    Directory    Specials    My Account    My Wishlist    My Basket  

There are a few tricks to saving files in MaxIm, especially if you plan on opening them again in a standard image-processing program such as Photoshop.  One is the all-important concept of histogram clipping, which probably cannot be overemphasized.  The most common file formats for saving CCD images are FITS, TIFF, and JPEG.

File Formats

  • FITS - Flexible Image Transport System.  FITS files are probably the best way to save CCD files, but they can typically only be read by CCD processing programs like MaxIm DL and CCDSoft.  (There are also FITS reader plug-ins for programs like Adobe Photoshop.)  FITS have file headers which contain information such as exposure time, date, telescope, temperature, etc.  All of the information contained in the original exposure is retained with FITS files, whereas other formats can sacrifice some of this information.

  • TIFF - Tagged Image File Format.  TIFF files are the best way to save color image files or any file you plan on transferring to Photoshop or a similar program.  Many image-processing programs cannot read 16-bit TIFFs (Photoshop version 6.0 or later being a notable exception) and 8-bit TIFFs must be used instead.  This requires you to sacrifice some image data, but this is almost never a problem (see below).

  • JPEG - Joint Photographic Experts Group.  These are the most common image files; most web images are JPEGs.  JPEG is a lossy image format meaning detail within the image is lost each time it is saved.  For this reason it is not recommended that you save an image more than once as a JPEG.  JPEGs are highly compressed (and different levels of compression can be selected before saving the file) allowing faster download times when being viewed over the Internet or when emailing your latest pictures to a friend.

 

Saving FITS Files

The nicest thing about saving files as FITS is there are not really any settings that need to be changed.  The data within the image is not modified when you save as a FITS.  Select File > Save As to open the Save As window.  Select the appropriate directory and fill in the File Name field.  In the File Filter pull-down menu, select FITS Images for the file type.  You can leave the Size Format set to 16-bit which will retain as much information as possible in the image.  Compression type can be left as Uncompressed to save all the possible information.

Note:  The only time information is lost with a FITS file is if you have summed images together which may give a maximum pixel value in excess of 65,535.  In this case, the data needs to be stretched to fit into a 16-bit format.  Using the Auto Stretch command is sufficient for this purpose.

 

Setting FITS Header

To set the information contained in the FITS header, select View > FITS Header from the top menu or press Ctrl-F.  When the FITS header window appears, click on the Edit tab.

If you wish to change the value of one of the keywords, select it with the mouse or use the pull-down menu at the bottom of the window to select the keyword.  Change the value in the Value field and click Set.  In the example above, the telescope was changed in the TELESCOP keyword to Celestron 14" f/7.  Certain values such as the CCD chip size, exposure time, temperature, etc., are automatically saved when the image is taken.

 

Saving TIFF Files

TIFF files are usually used for saving color images or for transferring a file from MaxIm DL to, say, Photoshop.  While Photoshop 6.0 and later can read 16-bit TIFFs, most programs (including earlier versions of Photoshop) can only read 8-bit TIFFs.  For most purposes 8-bit files are more than sufficient, but the data in a 16-bit CCD image (such as a FITS file) must be compressed, or stretched, to fit into the 8-bit format.

Suppose you have combined red, green, and blue files to create a color image (below).  The final image is a 16-bit file, but to save it so it can be read by another program you might want to save it as an 8-bit TIFF.  Begin by using the Screen Stretch function to make the image appear the way you want when you open it in another program.

Note:  Be sure to see the section below on Histogram Clipping for tips on setting the screen stretch.

Select File > Save As from the top menu.  This will open the Save As window.  Select the appropriate directory and fill in the File Name field.  In the File Filter pull-down menu, select TIFF Images for the file type.  Change Size Format to 8-bit Int, and set Compression Type to Uncompressed (this will retain as much information as possible).

In the File Details window you should see something like the following message: 

WARNING: Selected file format cannot accommodate largest pixel value in image.
Please enable Auto Stretch or use Stretch button to scale image.
Largest image pixel value: 6873.000
Maximum file format pixel value: 255.000

Click on the Stretch button in the Save As window.  This will open the Stretch window.  To stretch an image to fit an 8-bit TIFF format, use the following procedure:

  • Set Permanent Stretch Type to Linear Only

  • Set Input Range to Screen Stretch

  • Set Output Range to 8-bit

Click OK.  The Save As window should now show "Largest image pixel value: 255.000" in the File Details window.  Click Save.

 

Histogram Clipping

This is one of the most common mistakes made by beginning imagers.  Histogram clipping happens when the screen stretch is adjusted so that part of the lower end of the histogram is cut off.  This results in a loss of faint detail in an image as well as a less aesthetically pleasing result.  The biggest problems results when the histogram is clipped and then the image is saved out as a TIFF to be opened in Photoshop.  The lost data can now not be recovered.

Above:  An image of NGC253 with a proper screen stretch setting.

The image above has the proper screen stretch settings.  The histogram is not clipped and the left slider (black point) is at the very left end of the histogram curve, but not to the right of the end of the histogram.

Above:  Correct screen stretch settings.  The left end of the histogram is not cut off.

When the screen stretch is set with the black point slider to the right of the left end of the histogram, the faintest detail in the image is lost.

Above:  Moving the black point slider in Screen Stretch past the end of the histogram darkens the background but cuts off data.

Above:  NGC253 image with clipped histogram.  Note the lack of faint details compared to the first image.

When the image is converted to an 8-bit (or even a 16-bit file) to be saved as a TIFF, all the data outside the red and green screen stretch sliders will be lost.  For astronomical images, it is critical that the faint detail not be lost.  The resulting histogram after saving will look like the image below.  This is the surest sign of a clipped histogram.

Above:  Clipped histogram.

A clipped histogram is most likely to occur when trying to darken the background of an image.  It is imperative to not over-darken the background, causing the loss of detail.  If bringing the black point slider up to the very end of the histogram curve does not remove all the skyglow from an image (which can happen in an image with severe vignetting), it is preferable to save the image that way then remove the remaining sky glow using a tool such as Curves in Photoshop.  This will retain the faint detail you've worked so hard to capture in the first place.

 

Saving JPEG Files

If you wish to post your image to a website or email it to a friend, JPEG is the best format to use.  JPEGs compress the data within the image to make the file substantially smaller than a TIFF or FITS file would be.  There is a trade-off, of course:  Too much compression will degrade the quality of the image, and you should not save a file as a JPEG more than once because you lose information each time.

Tip:  Save a TIFF version of a completed file before saving it as a JPEG.  That way if you need to go back and make a slight change you can adjust the TIFF version and then just save over the first JPEG.

If saving directly from a 16-bit file type (such as FITS or JPEG) use the procedure outlined above for stretching the image to an 8-bit file before saving.

 

JPEG Compression

Because of the differences in CCD image files and the uses for which JPEGs are intended, there are no hard and fast rules for the amount of compression which should be used.  In general, compress as little as possible while retaining the amount of detail desired.  MaxIm does not give an indication of how large the final JPEG file will be, nor does it give a preview of the final quality, so you will need to experiment with your own files to see how much compression is appropriate.  If you have Photoshop, save your CCD images first as TIFFs in MaxIm and then open them in Photoshop to save as JPEGs since there are many more JPEG-saving features available in this program (see Photoshop section).

Set the JPEG compression amount in the Compression Amount pull-down menu.  The higher the Quality setting, the lower the compression and the larger the file size.

Return to MaxIm DL Page



Copyright ©2000-2008 Starizona
Adventures In Astronomy & Nature, All rights reserved
5757 N. Oracle Rd., Suite 103 · Tucson, Arizona 85704 · Call Us: (520) 292-5010
Map & Directions -  Return Policy