Type of Images (Jpeg, PNG, GIF)

By | May 3, 2022

JPEG

JPEG (or JPG) is the Joint Photographic Experts Group standard. It’s possibly the most common image format and is often used for posting photos or images of text online. This format supports 24 bits per pixel, 8 each for brightness, blue, and red, making this a “truecolor” format that can display over 16,000,000 colors.

Although it can create very high-quality images, JPEG can be disadvantageous in that it’s a lossy compression format. This is why you’ll often see low-quality, medium-quality, and high-quality options when you export an image as a JPEG. Each option decreases the amount of compression applied and increases the quality of the photo.

Below is the test photo in high-quality, medium-quality, and low-quality JPEG formats, with their respective sizes.

JPEG high-quality (quality set to 100) size: 471 KB

JPEG medium-quality (quality set to 50) size: 68 KB

JPEG low-quality (quality set to 20) size: 32 KB

In general, a high-quality JPEG is usually a good compromise between size and quality. Once you get to medium and low, the quality will suffer significantly. JPEGs tend to be best for photos or drawings, which have fewer sharp transitions than text.

GIF

The Graphics Interchange Format allows for 8 bits per pixel, three each of red and green, and two for blue. This makes 256 colors available for GIFs, though it is possible to get more colors into the image using multiple color blocks with different 256-color palettes.

Using lossless compression, GIFs are able to reproduce their limited color palettes perfectly over multiple decompressions and recompressions. Below is a test photo encoded as a GIF.

GIF size: 194 KB

As you can see, the size is relatively small, but the lack of color depth really hurts the quality of the image. It’s especially evident in transitions between light and dark, such as inside the rim of the blue pot with the yellow flower on the right side of the photo.

The other important thing to know about GIFs is that they can be animated, which has all sorts of cool uses. Using multiple image frames drawn in order, the appearance of motion can be generated. Beyond creating animations, the GIF format is rarely used due to its limited color space.

PNG

Designed as a replacement for GIF, the Portable Network Graphics filetype is another lossless format, but it includes significantly more information than its predecessor: it can contain either 24 or 32 bits per pixel.

The 24-bit version contains RGB information, while the 32-bit version uses the RGBA color space. The “A” in RGBA stands for “alpha,” which allows for different levels of transparency in the image (when you see a checkered background like the one above, it usually indicates transparency).

Because it contains so much more information, a PNG file will be quite a bit larger than a JPEG or GIF (though there’s an increase in quality, as well).

PNG size: 1.5 MB

Using the example photo, the PNG doesn’t look any better than the high-quality JPEG, though it’s important to remember that lossless compression will maintain the quality of the photo over multiple decompressions and recompressions.

At 640px wide, the PNGs in this article aren’t big enough to make the differences between filetypes extremely apparent, but you’ll definitely see it in printed photos, which makes this format ideal for printing 8″ x 10″ photos or larger. And if transparency is something you want as well, PNG is the way to go.

Leave a Reply

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