Menu

GIF vs JPEG

GIF=Graphical Interchange Format

JPEG or JPG=Joint Photograph Experts Group

Introduction

GIF and JPG file formats have been around since the early days of web graphics. Both are compression formats for graphic files. Which extension do you wish to use? The answer depends on what type of image it is you wish to compress.

JPEG ( jay-peg )

The JPG format supports a palette of over 16 million colors.This will allow you to compress high photograph quality images without much loss in quality, but the large palette could make for a huge file size, depending on the quality of the original image. When JPG compresses the file, the more you compress it the more you will loose quality in the image. Basically JPG compression equals loss of image data. You should experiment with your file to see how much you can compress it before you save it, to see how much quality you are willing to loose for the sake of compression. With this in mind, JPG still works great for high quality images.For images that are less in color complexity, compression may be too obvious and the degradation in quality will be much more noticeable.

GIF

Unfortunately, GIF images can only be 256 colors at the most, however it is the fact that you can use less colors that makes the GIF format more attractive at times. With the GIF format, you can reduce the color palette to suit the image, which reduces image size but not quality, because compression is not necessary.

Another advantage with GIF is you can create transparent images. With that I mean you pick a color in the images palette and make it transparent, so no matter what color background you place the image on, it will blend in perfectly. GIF is also the format of choice when creating animated images, buttons, banners, or icons.

Here are 2 images. One of them is a JPEG, the other a GIF. Can you figure out which one is the JPG and GIF without cheating?

If you guessed that the top one is JPEG, and the bottom is GIF, you guessed right. These were both the same original image, the top JPG image is 9k in size, and the bottom GIF is 26k in size. As you can see in this case with a large color palette, JPG does a much better job of compression.

Here are 2 more images. Can you guess which one is JPEG and GIF now?

If you guessed that the top one is GIF, and the bottom is JPEG, you guessed right. These were both the same original image, the top GIF image is 4k in size, and the bottom JPEG is 5k in size. The difference may not be much, but the images are small with a small color palette. The GIF image was reduced to used only 30 colors, but the difference between the 2 images isn’t really noticeable because of the minimum number of colors that was used to create the original image.

  • For photographs, or high images with a large color palette, use JPG for compression.
  • If you want to create a transparent image, you will have to use GIF.
  • For logos, or images with a small number of colors, use GIF.

The bottom line is to experiment with both with your images, and find which one you like better for a particular image.

Leave a Reply

Your email address will not be published. Required fields are marked *