JPEG

From TheAlmightyGuru
Jump to: navigation, search

JPEG or JPG, is an electronic image format created by the Joint Photographic Experts Group in 1992. The format uses a discrete cosine transform to achieve a lossy encoding which can reduce typical photographs to about 1/10th their original size with only minor visual degradation. In 2000, the Joint Photographic Experts Group tried to replace the format with a superior JPEG 2000 format, but few programs adopted it since it was only marginally better than the original. The format has native support in every major operating system and Web browser. Although the format is still especially popular, it is slowly being replaced by the lossy encoding of WEBP which compresses at a noticeably better rate and supports a lot of new features, but is also the official Internet lossy bitmap graphic format.

Compression Examples

Because JPEG images are based on wave forms rather than pixels, their file size, along with their image quality, can be easily adjusted. Below I examine how artifacting is expressed with the decrease in quality. Each image is compressed using Corel Photo-Paint X7.

Uncompressed (769 KB)

Compression Test Image.png

This is the test image. It combines a photograph, text, gradients, checkerboards, and a screenshot so you can see how JPEG compression acts on each graphic style. The image is 512x512 pixels with a 24-bit color depth, resulting in an uncompressed size of 786,432 bytes.

100% JPEG Quality (234 KB)

Corel Photo-Paint X7 - JPEG - 100%.jpg

This is the same image using JPEG compression at 100% quality. Although the file size has dropped to 238,998 bytes, less than a third of the size of the original, the quality is nearly identical. Unless a person were told, they might easily mistake this for the uncompressed image. Only someone with a keen eye for compression artifacts would spot them in the red gradient. In JPEG compression, the color red always degrades the most.

85% JPEG Quality (96 KB)

Corel Photo-Paint X7 - JPEG - 85%.jpg

At 85% quality the resulting image is only 98,303 bytes, eight times smaller than the original, and compression artifacts are still barely noticeable. Hints of artifacting can be seen around the text and color loss is just starting to be noticeable in the Super Mario Bros. screenshot.

50% JPEG Quality (59 KB)

Corel Photo-Paint X7 - JPEG - 50%.jpg

Now at only 50% quality, the file size has dropped to 59,927 bytes, over 13 times smaller than the original, however, the quality has taken severe drop. The photo is clearly not as crisp and the text, though still readable, has a lot of visible noise around it. The gradients are getting a little choppy near the light end, the white squares in the checkerboards are getting messy, and all the sharp contrast changes in the screenshot leave significant artifacts.

25% JPEG Quality (43 KB)

Corel Photo-Paint X7 - JPEG - 25%.jpg

At 25% quality, we're now seeing diminishing returns. We've only saved about 16,000 bytes, but the appearance has suffered drastically. The file is now 43,675 bytes, about 18 times smaller than the original. The photo now looks awful, the text has so much noise, it's hard to read, the gradients have obvious color banding, the checkerboards are quite messy, and the screenshot looks like garbage.

10% JPEG Quality (30 KB)

Corel Photo-Paint X7 - JPEG - 10%.jpg

At 10% quality, we've only saved another 13,000 bytes, but the image is practically unusable. There is clear blocking and color banding all over the image, and the text can easily be misread. The image is only 30,242 bytes in size, but it doesn't matter much at this point.

5% JPEG Quality (24 KB)

Corel Photo-Paint X7 - JPEG - 5%.jpg

At 5% quality, the image is 24,283 bytes, but it's an absolute mess. Most of the text is unreadable, the the face is hugely distorted, the color is in big chunks and, in many places, very off.

1% JPEG Quality (21 KB)

Corel Photo-Paint X7 - JPEG - 1%.jpg

At 1% quality, the image is only 21,285 bytes, 38 times smaller than the original, but it's wasted data. The face is so bad, it's unrecognizable, the text is illegible, and the other graphics are just as bad. Describing the image with text would take less space.

Software

The following programs support JPEG in some capacity.

Program Type Notes
Corel Photo-Paint Raster Editor Supports many different format options including JPEG 2000.
GraphicsGale Raster Editor Supports some features.
Paint.net Raster Editor Supports some features.
ImageMagick Raster Programmer Programmably create images. Supports pretty much every format option, including JPEG 2000.
IrfanView Image Viewer Can open and display JPEG images.
PabloDraw Image Viewer Can open and display JPEG images.
JPEGOptim Compression Optimizer Can decrease file size without losing quality, or decrease it more with a quality loss.
LibreOffice Document Editor Can import and export to JPEG.
Corel Draw Vector Editor Can import and export to JPEG.
Inkscape Vector Editor Can import and export to JPEG.
XPDF Image Extractor Can extract JPEG images from PDF files.
foobar2000 Jukebox Primary format for embedded album art.

Links

Link-Wikipedia.png