Understanding graphic image file formats is key in how to post-process your digital images.
There are literally hundreds of different graphic image file formats. Here is a comparison chart that I use, along with a brief description, of the most relevant file formats for photography.
* Raw: This file contains the data directly from the camera's image sensor and camera settings, [mostly] unprocessed by the camera's processor, and [mostly] uncompressed. It uses either the Adobe RGB or the ProPhoto RGB Color Space (depending on the camera manufacturer), with a color depth of 12-14 bits per channel, or up to 42 bits per pixel. This is not one file format but is a family of about 230 of proprietary (and mostly undocumented) raw formats; each camera manufacturer has its own raw format; even each camera model might have its own raw format. As a camera model is discontinued, the associated raw file format may become unsupported and obsolete. Some manufacturers may even encrypt this file to prevent third-party access.
* DNG: This file is based on the TIFF file format, and uses a lossless compression. It's developed by Adobe as an open file format to overcome the limitations of the Raw file formats (ie, proprietary, encrypted, non-standardized, etc.). They are pushing this file format to be adopted by all camera manufacturers, and to replace the current various Raw formats.
* TIFF: This file uses a [mostly] lossless compression. It is good for printing because it can use a large Adobe RGB color space (ie, it can exploit the wide range of colors offered by the commercial printers) and because it can embed ICC color profiles. (Hence, it's "device-"dependent.) It's not good for display over the Internet because there are a number of its variations (different color depths and compression methods).
* BMP: This file stores a simple description of the image pixels in an uncompressed form. The drawbacks are that the file size is large, and it's Windows-specific (platform-dependent).
* Exif: This file is basically a JPEG file with TIFF file features. It contains camera setting data.
* JPEG/JFIF: The JFIF file format uses a lossy JPEG compression on a 24-bit color file, resulting in a small image file size, suitable for display over the Internet. It's not great for printing because of its lossy compression and its use of the small sRGB color space (ie, its inability to exploit the wide range of colors offered by the commercial printers).
* PNG: This file is a newer version of the GIF file format and has TIFF file features, and it can replace the JPEG file for web applications. It uses a lossless compression on a 24-bit color file. The drawbacks are that the file size is larger than JPEG, and some older web browsers cannot read the PNG file.
* GIF: This file uses a lossless compression on a tiny 8-bit color file (that can show only 256 colors), resulting in a tiny file size. It's good for simple images that do not have a wide range of colors. It supports animation, making it the preferred choice for animated graphic images to be displayed over the Internet.
Why is it good to know all of this?
* When you buy your camera, if the camera offers Raw format, it should come with a Raw processing software. Save the software, because this particular camera model's Raw file format may become obsolete one day, and you won't be able to access your Raw image files without this processing software. (Imagine losing your 35-mm film negatives.)
* When you shoot, if the camera allows it, choose the Raw file format and Adobe RGB Color Space. This way, you have a wider choice and better quality when you post-process your images.
* When you post-process your photos, use the TIFF file format in the Adobe RGB Color Space. Use the 48-bit color depth if you don't mind the heavy toll on disk space.
* When you print, send the TIFF files to the printer, with the ICC color profiles embedded in them.
* When you send the photos over email or put them up in the Internet, convert the images to JPEG. This changes the color space to sRGB and 24-bit color depth, resulting in a smaller file size. If the image does not have a lot of color information in it, you can even convert it to the GIF format to reduce its size even further.