Question
If I edit an image file using some application like Gimp, Photoshop or MSPaint, while saving I will be asked to select the required file-format. There are different formats available, the common ones are jpg, png and bmp. Other less common options are gif and tiff.
So which option should I select? What are the merits and demerits of using a particular file format?
Answer
JPEG is lossy, which means it compresses the image (in part) by discarding data. The data it discards is (normally) chosen to minimize the affect on the quality of the image, but it (virtually) always loses at least a little quality -- and depending on the quality level you choose, it can lose quite a bit. For most photographs it should be considered a display-only format -- once you've converted something to JPEG, you don't want to do any more editing on it. If you need to make changes, you re-start from some other format, make the changes, and do another JPEG conversion.
GIF uses only lossless compression, but is limited to 8-bit (256) colors, which is quite limiting for photographs.
PNG was designed as a replacement for GIF, and mostly succeeds. It supports 24-bit color (8 bits each for red, green, and blue) and uses lossless compression.
TIFF is really a container format that allows you to insert various kinds of data into the container. While it's used primarily for images, it's really almost like a file system, so you could theoretically use it for almost any kind of data. This has a couple of consequences. One is that even if a program supports TIFF files, it may not support all TIFF files -- e.g., many don't support LZW-compressed images. In fact, few programs support all possible TIFF files. Another consequence is that TIFF tends to have a fair amount of overhead, and writing code to support TIFF (at all well) is a pain (which is why so many programs support it only incompletely).
BMP is basically just a Windows device independent bitmap written out to disk. It has only extremely limited support for compression (and most BMPs aren't compressed at all). Programs written for Windows can read/write BMP really easily, but there's not much else to recommend it (in particular, BMP files tend to be quite large for the amount of data being stored).
Conclusion: JPEG is useful as an output format (e.g., to display things on web pages it's good because it's compact, and virtually everybody can read it).
As an intermediate format that you might use (for example) to store a file that might later be edited, TIFF is about the only one of these that's really of much use.
The others (GIF, PNG, BMP) aren't really of much use for photographs.
Check more discussion of this question.
No comments:
Post a Comment