When we browse the web, we see images. For casual users, an image is just a bunch of pixels. But in reality there are different kinds of image formats; each as distinct as chalk and cheese. The four common types are – JPG, PNG, GIF, and BMP.
If that’s all Greek to you, worry not because this little article will try to put each of the four common image formats in their common place. Each of the image formats was created for specific uses, and as such each has their own advantages and disadvantages. All raster images where each little bit of image data are saved in pixels (tiny dots of individual color) are saved in any one of these formats.
Also on Guiding Tech
JPG (Joint Photographic Experts Group)
JPG is the de facto standard image format and the most popular one used on the web. JPG supports 16.7 million colors and is the preferred format for photographs. JPG files are also smaller in size as compared to other image formats because it uses ‘lossy’ compression to reduce the file size.
It may not be evident to the human eye, but JPG images sacrifice some image information to keep file sizes small. Each time you save a file, some data is lost. This loss of image data is not recoverable. Of course, the amount of loss of image data can be adjusted according to the image size you can tolerate. High quality corresponds to low compression, and vice-versa.
JPG images are ideal for rich color photographs, gradient images, and web images for their small size. It is not suitable for line drawings and animations. JPG also does not support transparency.
GIF (Graphics Interchange Format)
If an image has large areas with flat or single tones colors, then GIF is the format of choice. Think logos, icons, banners, and cartoons which are all preferably GIF images. The GIF format supports 256 colors (i.e. an 8-bit color palette). As they use only 256 colors, they make for compact images and consume less bandwidth.
GIF is widely used in animation because it enables transparency and interlacing (an image becomes progressively clearer as it downloads). They lack the color range to be usable for photographs and are gradually being used less.
PNG (Portable Network Graphic)
The PNG format was designed as an elegant alternative to GIF. It was also designed as an open patent free format usable by everybody, as against the proprietary GIF format. PNG handles transparency more efficiently than GIF.
Like GIF, the PNG format supports 8-bit color but also extends it to 24-bits, thus giving you more color ranges to work with like in a JPEG file. PNG files do not support animation. PNG files are also lossless files retaining color information when they are compressed. Richer images will lead to larger file sizes.
The native file format of the Windows platform is like the parent format to the above three. BMP formats commonly do not allow for image compression unless they are saved in any of the formats discussed above. BMP images are crisp and precise, but being pixel dependent they don’t scale well. On the web, the detail comes at the cost of file size and that’s why you won’t see BMP images used on the web.
Which one to use?
Use of a specific image format will vary according to the situation, but these are the thumb rules you can follow.
JPG is the most common format that’s in use. But you should be careful as image quality degrades with every save.
PNG makes for great screenshots if there are no gradients in the original source. PNG is also a good option for images which need transparency.
GIF is great for clipart and drawings where limited colors are in use.
So, which of the above image formats do you come across or use often?