THE DIFFERENT IMAGE FORMATS

It is not easy to navigate the different image formats (FIT, FTS, RAW, TIF, TIFF, BMP, JPEG…). Since it is common to switch from one image format to another in astrophotography, it is important to know what happens when changing formats during image processing to avoid losing part of the image. information that took a lot of effort to acquire during the astronomical imaging session.

Designing a digital image

In digital imaging, the information is encoded using 0 and 1. It is therefore a binary encoding. This elementary information of two possibilities is called the bit. Applied to a digital image, each pixel of the camera can detail one of the following values:

  • One bit: There are only two possibilities: Black or white.
  • 2 bits: 4 different shades or tints possible (2 x 2).
  • 4 bits: 16 possible shades (2 x 2 x 2 x 2) or 2 to the power of 4.
  •  8 bits: 256 possible shades (2 to the power of 8).
  • 10 bits: 1024 possible shades (2 to the power of 10).
  • 12 bits: 4096 shades (2 to the power of 12).
  • 14 bits: 16384 shades (2 to the power of 14).
  • 16 bits: 65536 shades (2 to the power of 16).
  • 24-bit: 16,8 million shades (2 to the power of 24).
  • 32-bit: 4295 million shades (2 to the power of 32).
  • And so on.

This basic explanation will help us understand all the different image formats. It will also be understood that the more bits a pixel contains, the larger the image will be and will occupy more space on the hard disk of the computer. Also, the larger the image, the more power the processing of this image will require from the computer's processor.

The basic image format BMP

The BMP image format (with .bmp extension) is considered basic for producing a photo. The image is in 8 bits (256 different shades possible). It is mainly used to produce color images with a digital color camera. A Red, Green or Blue color filter is added to each pixel to produce the color image (4 pixels are used, 1 red, 2 green and 1 blue). The resulting image has 3 layers of RV and B colors. Each layer has 8 bits. The color image is therefore worth 24 bits (3 images of 8 bits each = 24 total bits). We can therefore produce 16,8 million shades of colors differents with this format. It should be noted that this image format is not used much nowadays. in APNs. Also, there are people who designate this 8-bit format and others 24-bit. It should be understood that when we designate this format in 8 bits, we mean that it can produce 256 different shades. When designated as 24-bit, it indicates that a color image in BMP format can produce 16,8 million different color tones. Whether it is designated 8 bits or 24 bits, this format does not change, it remains the same. This observation is also valid for all image formats. It is important to understand this nuance in the designation of image formats. Myself, I was confused in the designation 8 bit and 24 bit. I thought there were 8 bit BMP image formats and 24 bit image formats until I understood that we were describing the same format (8 bits = 256 different shades per color channel and 24 bits = 16,8 , 3 million total shades of different colors for the XNUMX coats).

The image format in FITS astronomy

The FITS or Flexible Image Transport System image format is the most widely used image format in astronomy. It is designed specifically for scientific data. It can carry the file extensions FIT or FTS among others. An important feature of this format is that it has a text data header, in ASCII format, for recording the data on the shot. It is available in 16-bit and 32-bit, but the most used in CCD imaging is 16-bit. The image produced is monochrome. On the other hand, a color image can be produced by taking individual images with a Red, Green and Blue filter. For more details, see the LRGB technique of this site. Also, with a color CCD camera, this format can be used in RAW mode (see below) to produce a color image.

Although this image format is 16-bit, it is intended to contain negative values ​​which are used in thes fields scientifics imaging such as x-ray, infrared and photometry. It can therefore contain imaging data from -32767 to +32767. This is the most common format. It is called signed format. It is noted that some manufacturers, like Starlight, use the positive 16-bit format (0 to 6553= 5 65536), called an unsigned format, but it is less used. Most preprocessing software can read these 2 types of formats. However, some imaging programs fail to read the signed format correctly. The main reason is that they don't shift negative values ​​to go from 0 to 65535.  Par example, the software Fit Liberator does this shifting job very well and therefore preserves the 16-bit data of the signed format in its integrity. In addition, it makes the two formats perfectly compatible.

The image produced in this format is not compressed. It should be noted that the image can be saved in a compressed FITS format. In astronomical imagery, never use this function to archive your images, because they will be degradeds.

When looking at the images on the screen, they are very dark. These are raw images without software processing to make them appear visually beautiful. No cosmetic additions are added. By the same token, they are of great purity. If we look at the histogram of these images, we will see that all the information on the image is there. The preprocessing and processing of these images will visually bring out all the details and nuances.

RAW mode

RAW mode is used for digital cameras (APNs) and color CCDs that take the images. en color in one exposure. If we look at an image directly in this mode, it is monochrome. But the image retains the colors. These are raw images that come directly from the CCD or CMOS sensor. They are not "tinkered with" by the internal software of the device to make them more visually presentable. In addition, they are of great utility in astronomical imaging, because we can perform the preprocessing of these images in monochrome which is the ideal format to perform this task. After this preprocessing, the image can be converted to color. This mode is uncompressed, so that it keeps all the information about the image intact.

For color CCD cameras, the aspect ratio for this RAW mode is 16-bit FITS (per color) most of the time. It therefore has all the peculiarities of this format (including the text data header). For the APN, it is rather the jungle because there are no standards. They are 10 to 14 bits per color (RGB). As the RAW mode is not directly usable in color, it is necessary to use software to extract the three fundamental color planes (red, green and blue) and again there are no standards. So, to extract the colors, you have to use the right Bayer matrix and it is not easy to navigate, because the manufacturers do not always give the information on their own matrix. It's still the jungle on file extensions. At Canon, these files have the extension CRW, at Nikon, the extension is NEF, Olympus .ORF and at Fuji .RAF.

The RAW mode is found in the high and mid-range models of these manufacturers. So if you are using this mode to produce your astronomical color images (in one go), make sure you have the software that will extract the 3 color planes using the correct Bayer matrix.

The TIFF image format for processing images with Photoshop

Photoshop software cannot directly read FITS format images. For this reason, we must convert these images to TIFF format (with .tif or tiff extension). This format is 16 or 32 bit and even 64 bit. For the conversion, the 16-bit TIFF format is used, because the original image is of the same format (16-bit FITS). In order not to lose part of the information contained in both signed and unsigned FITS files, software should be used which will amplify the signal without losing any data before converting to TIFF format. Indeed, it should be remembered that the images in FITS format are raw images without software processing to increase the weak signal of these dark images (see explanation above). Software designed specifically to do this conversion job without losing data will be discussed in the sections on preprocessing and processing astronomical images.

As for the FITS format, never archive your images in compressed TIFF because they will be degraded.

The JPEG image format for the web

The JPEG image format (with the extension .jpg) is a format developed for compressing images. It is mostly used for posting the images to the web. We therefore convert our images from TIFF format to JPEG format for presentation on the Web (always keeping the image in TIFF format in our archives). It should be noted that this compression degrades the image. The higher the compression rate, the more degradation of the image. In addition, with each backup, the degradation increases (a new compression is performed for each backup). You should therefore never use this format to archive your astronomical images. The standard conversion takes place in 24 bits, i.e. 8 bits per RGB color (16,8 million different color tones).

PNG format

The PNG format (with .png extension) allows information to be saved up to 16 bits for a monochrome image or up to 48 bits for a color image. The proposed lossless compression is 5% to 25%. This format can be interesting if you do not have access to the FITS or RAW format when shooting.

Proprietary image formats

Here is the presentation of two proprietary image formats often used in astronomical imaging:

Photoshop's PSD format

It's a great working format for Photoshop. It supports 8, 16, 24 and 32 bit monochrome images, RGB color, CMYV (Cyan, Magenta, Yellow and Green or CMYG in English) and the color LAB (based on the colors perceived by the human eye) for photographic image editing. It can contain information from several layers (for color imagery among others), management of layers and masks, vector paths, etc. Several astrographers recommend using this proprietary format for processing astronomical images with Photoshop. You therefore have the choice of using the PSD or TIFF format for processing your astronomical images with Photoshop. Personally, I use the TIFF format, because it also supports the management of layers and masks in Photoshop.

The PIC format of Iris

If you are using the Iris software to preprocess your deep sky color RAW images from your digital camera, you must use the latter's proprietary PIC format. It is the only Iris format that can contain 48-bit color data (16-bit per RGB layer). The PIC format also offers better performance in terms of processing speed.

Other image formats

There are other image formats, but they are less important for deep sky imagery.

Recommended image formats for deep sky imaging

  1. For the acquisition ofs images and preprocessing: the 16-bit monochrome FITS (LRGB) or FITS format in RAW mode for color CCD cameras and for digital cameras the RAW mode offered by the manufacturer
  2. 16-bit TIFF (or Photoshop's proprietary 16-bit PSD format) for image processing
  3. 24-bit JPEG (8-bit per RGB color) format for posting images to the web

Richard Beauregard
The Sky Astro-CCD

Revised 2021/11/03