🎨 Linear Images, Histograms, and File Formats

Understanding Your Data · lesson 1 of 12 · 3 min

You come out of a night of imaging with dozens of files, you open one, and the screen is almost black, with a few stars. Nothing is wrong: you are looking at a linear image. Understanding what it contains is the first step of any processing.

Linear and nonlinear

In a linear image, the value of each pixel is proportional to the amount of light received. If an area receives twice as many photons, its value is twice as high. This is exactly what the sensor measured, and that is why calibration, stacking, gradient removal, and color calibration are done on linear data: they rely on calculations (subtractions, divisions, averages) that only make sense if the values remain proportional to the light.

The problem is that deep-sky objects are very faint. Their pixels occupy a tiny part of the available range of values, very close to black, while the cores of bright stars climb to the maximum. On screen, the image looks empty.

To make it visible, you apply a stretch: a curve that strongly brightens the faint tones and compresses the bright ones. The image then becomes nonlinear. In practice this step is irreversible, and most "physical" processing should no longer be applied after it. Remember the general order: calibrate, stack, correct the background and colors in linear, then stretch, then finish.

Siril offers display modes (including an automatic stretch) that show the stretched image without modifying the data. This is very handy for judging work in progress, but do not mistake this preview for an actual stretch.

Reading a histogram

The histogram counts how many pixels have each value, from black (on the left) to white (on the right). On a linear deep-sky image, it looks like a very narrow peak pressed against the left edge: that is the sky background. The nebula's signal hides in the right foot of this peak. A healthy histogram does not touch the left edge: pixels crushed to zero are lost information. On the right, a few saturated stars are normal.

You will come back to the histogram at every step: it is the most reliable tool for knowing whether you have darkened the background too much, pushed the highlights too far, or thrown the colors off balance.

FITS and RAW

Dedicated astronomy cameras generally record in FITS, the astronomers' standard format. It stores the pixels without lossy compression, with a header that keeps the date, exposure time, gain, sensor temperature, or target coordinates.

DSLR and mirrorless cameras record in RAW (CR2 or CR3, NEF, ARW depending on the brand). A RAW file contains the raw sensor data before any in-camera processing. Siril reads these files directly and converts them into a FITS sequence to work on.

Never use JPEG for processing: this format already applies a curve, a white balance, noise reduction, and compression that destroy the faint signal.

Key points

  • A linear image keeps values proportional to the light received: it looks dark, and that is normal.
  • Calibration, stacking, gradient, and colors are handled in linear; the stretch comes afterward.
  • Siril's automatic preview does not modify the data.
  • A histogram pressed against the left edge signals crushed blacks, and therefore lost signal.
  • Process FITS or RAW files, never JPEGs.

🧮 Exercise

Open one of your light frames in Siril. Compare the linear display and the automatic stretch, then look at the histogram: find the sky background peak and check that it does not touch the left edge.