PDA

View Full Version : Image file in integer or rational



Jairo
2013-May-12, 10:12 PM
Hi,

A question for people who work with digital images: what is the difference and application of files (like TIF or FITS) in integer or rational?

Thanks.

chrlzs
2013-May-15, 09:34 AM
Hi,
A question for people who work with digital images: what is the difference and application of files (like TIF or FITS) in integer or rational?
Thanks.
I can't help noticing your question has been unanswered, so I'll briefly delurk and break my 'no more posts at baut' decision... :D

In very brief terms almost all 'common' image file formats, like JPEG and TIFF, store the image data to a certain bit depth. It's usually 8-bits per channel, in other words each pixel contains 3 x 8-bits (256 combinations) data - the 3 being the three colour channels Red Green and Blue. Hence the standard RGB nomenclature, where one pixel might be 0,0,0 = Black, 255,255,255 = White, 127,127,127 = Grey, 200,0,0 = a pretty deep red, 120,120,0 is a mid brown, 0,180,180 is a pale greenish blue and so on.. (Note that bits per pixel is different to bits per channel..) Different image file formats can have less or more bit-depth, depending on your needs.

FITS files are not so much an image format as a generic, user configurable scientific data storage file. It can be configured for 8- or 16-bit depth image data, but it might be set up for 12-bits or a converted analogue reading stored to X significant digits, or ... pretty much anything. I don't know what the common FITS formats are, but you need to know the configuration of the data before you can use it, obviously.

Don't know if that helps you, but maybe this bump will motivate other more knowledgable folk to correct me!

ngc3314
2013-May-15, 05:47 PM
The FITS header tells how many bits/pixel are used, and whether they are stored as signed or unsigned integer or floating-point (an IEEE standard is used). FITS files may contain raw data (often unsigned integer, as counts from an analog-digital converter), reduced data (in which various corrections for instrumental sensitivity make them non-integer), or calibrated to physical units and thus definitely requiring floating-point form. The FITS standard was defined to work with all "word depths" common in the 1970s, so 8,16, and 32-bit pixel sizes have always been common. The current standard (http://archive.stsci.edu/fits/fits_standard/node39.html#SECTION00941120000000000000) specifies that values 8,16,32, and 64 are valid; a negative sign indicates that pixels are stored as IEEE floating-point values.