Follow this Blog!

Aug 3, 2012

AmazonJPEG? GIF? PNG? What are they? How are they different from each other? When should I use each of these image types? In this tutorial we'll be answering all these questions!

To be specific once you finish reading this article you'll be able to answer the following questions:

1. I need transparency in my image. What image format should I use?
2. I took a screenshot of my desktop. What image type is the best?
3. I'd like to put a photo on my website. What image format yields the lowest file size?Comparison of Common Image Formats
JPEG, GIF, PNG, ICO, TIFF, BMP are six of the most common formats for images and graphics. They each have their advantages and disadvantages. Some support many colors; others support only a few. Some require much less disk space to store than others. Here is a table that compares the critical aspects of each of them. 'Lossy' means the image is stored at a less quality level in order to reduce image file size. 'Lossless' means the image is stored with NO quality loss.

When you need simple animation or when you need transparency in a single, simple image

For simple images such as a desktop screenshot

Use ICO only for favicons as ICO is the only format supported by all major browsers.

Professional photos with no loss of details

You should never use BMP.

You should NEVER use TIFF or BMP for images that you display on a website! If you beg to differ let me know!Conclusion
So here's the conclusion of when you need which image format.

When you need to store on your computer or a hard drive a professional photo where quality is a must, pick PNG or TIFF. Use Microsoft Paint to save the same photo in PNG and in TIFF separately to find out which format yields a smaller size. Based on my experience they yield equally big files.

When you need to display photos on your website then use JPG/JPEG. JPEG does an excellent job of reducing file size at a small expense of the image quality, and the loss in quality is mostly imperceptible to our eyes anyway.

When you need transparency in a simple image use GIF. GIF yields a much lower file size. I've tested storing a 100 pixel by 100 pixel image and a 500 pixel by 500 pixel image as GIF versus as PNG and the savings in size when stored as GIF go from 12% to 35%! HOWEVER keep in mind a GIF image only supports up to 256 colors!

When you need transparency in a not-so-simple image use PNG. Basically if your image contains more than 256 colors then it is considered not-so-simple.

When you need to play a simple animation go with GIF. Note each frame of the animation should not contain more than 256 colors.

What if you need a complicated animation? Then use Adobe Flash!
When you need to store a simple image or an image with several colors in it go with PNG. My experience suggests a screenshot of your desktop fits in this category. When in doubt you can also use Microsoft Paint to find out whether PNG or JPEG yields a lower file size.

You should use ICO when you are creating 16x16 favicons for your websites.

Again you should NEVER use BMP.

So here's a test for you. What image type should you use to save a complex photo with some areas of transparency in the photo?