JPG, GIF, TIFF, PNG, BMP. What are they, and how do you choose? Part of the reason for the variety of file types is the need for compression. Image files can be quite large, and larger file types mean more disk usage and slower downloads. Compression schemes can by lossy or lossless. Another reason for the many file types is that images differ in the number of colors they contain. If an image has few colors, a file type can be designed to exploit this as a way of reducing file size.
Lossy vs. Lossless compression
A lossless compression algorithm discards no information. It looks for more efficient ways to represent an image, while making no compromises in accuracy. In contrast, lossy algorithms accept some degradation in the image in order to achieve smaller file size.
The file types
TIFF is used almost exclusively as a lossless image storage format that uses no compression at all. (Sometimes a lossless compression algorithm called LZW is used, but it is not universally supported.)
PNG is also a lossless storage format. However, in contrast with common TIFF usage, it looks for patterns in the image that it can use to compress file size. The compression is exactly reversible, so the image is recovered exactly.
GIF creates a table of up to 256 colors from a pool of 16 million. If the image has fewer than 256 colors, GIF can render the image exactly. GIF is “lossless” only for images with 256 colors or less.
JPG is optimized for photographs and similar continuous tone images that contain many, many colors. It can achieve astounding compression ratios even while maintaining very high image quality but it is lossy.
RAW is an image output option available on some digital cameras. Though lossless, it is a factor of three of four smaller than TIFF files of the same image.
BMP is an uncompressed proprietary format invented by Microsoft. There is really no reason to ever use this format.
PSD, PSP, Photoshop’s files have the PSD extension, while Paint Shop Pro files use PSP. These are the preferred working formats as you edit images in the software, because only the proprietary formats retain all the editing power of the programs |