I am new to astronomy and I found that the telescopic dataset can be stored in the FITS format instead of JPEG. Why do we have a special image format just for scientific images?
File formats tend to be industry/field-specific, with the format, tools, and expectations of the field coevolving to become more dependent on each other over time. JPEG co-evolved with amateur digital photography, PNG co-evolved with the web. Likewise, FITS co-evolved with astronomical data processing, and so is naturally more suited for that purpose than formats that had entirely different goals and communities involved in their development.
(Pedantic nit: JPEG is the name of the compression method and the group that designed it. The file format is technically "JFIF", but everybody colloquially calls it JPEG.)
As an image format, FITS has a number of desirable qualities that are lacking in JFIF and PNG, that are crucial for scientific data:
- Storage of more bits per pixel (CCDs can records 12, 14, or more bits), and also floating point values.
- Storage of arbitrary number of data channels (scientific data may have many, or other, frequency bands than the RGB that JPEG and PNG are limited to).
- No lossy compression as is typical (though not strictly required) for JPEG.
- Higher resolution (JPEG/JFIF, for example, is limited to 65,535 pixels in each direction), and FITS is also capable of storing 3D data volumes.
- Support for unlimited metadata in the header, for example the sky coordinates, information about the telescope, etc. JPEG and PNG don't have the fields and aren't set up to record arbitrary metadata.
Also, the use of FITS for astronomy predates the existence of both JPEG/JFIF and PNG -- FITS was standardized in 1981, JPEG in 1992, PNG in 1996. So even if those formats were suitable (which they are not), by the time they were invented there was already widespread use and existence of astronomical image processing tools that were geared to FITS files (and growing archives of astronomical data in FITS format), so it would have been a major effort to switch formats that would never be undertaken unless a new format not only met but exceeded all the prior requirements of the field.
FITS has a lot of nice features which formats like PNG don't have, like astronomical coordinates (where in the sky does the image correspond to?) and storing multiple exposures. Most traditional image formats also aren't as flexible. For example, FITS supports floating point data storage, where pixels on an image can have precise values like 1.2324241, whereas PNG has 256 possible values in each of the four channels (rgba).