GIF vs JPEG

There must have been times when you would have wondered what the difference is in pictures of type “GIF” (having file extension .gif) and those of type “JPEG” (having file extension .jpg). At other times you might have wondered which type to use for a picture you are uploading. Well, today I am going to solve the problem for you.

GIF stands for Graphics Interchange Format, and is more suited for computer generated graphics and images. This is because it can hold a maximum of 256 colors. If the picture you are saving as GIF has more colours, they will be “approximated”. Leaving aside this limitation, GIF is a wonderful format. You can mark some of the pixels as “transparent” which means that those pixels do not have a colour of their own, and will take up the background colour when the picture is displayed. This makes them merge easily with any background. In addition, you can create animations as well using GIF format.

On the other hand, JPEG, standing for “Joint Photographics Experts Group” can store true 24 bit color, and is used more often for real life photographs. This is because real life photographs normally have more than 256 distinct colors. However, these support neither animations, nor transparent pixels.

The compression used by GIF is mostly lossless, while that used by JPEG is lossy – which means that a JPG image will loose some quality each time you save it, where as a GIF will not.

Share

Licensing and information about the blog available here.