Wednesday, 19 December 2012

telescope - Why do we use FITS format for scientific images especially in astronomy? How is it different from formats such as JPEG, PNG etc?

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.

No comments:

Post a Comment