So, Why Does JPEG Suck?

December 16, 2016  •  Leave a Comment

In a recent article I briefly mentioned (well, it was a parenthetical part of the title) that JPEG sucks. I showed an example but didn't further elaborate. Today I'll elaborate.

The Basics
The JPEG file format was developed by an ISO working group to facilitate transmission of photographic images across the internet by reducing the size of the files. (You can read waaay more than you care to about its history and technical details on 
Wikipedia.) It rose to popularity because it does what was intended: reduce the amount of data required to store an image that looks like the image and, thus, move that image from place to place more quickly. (This was in the days of dial-up connections, so cutting the file size by 90% was a really big deal, especially when you were dialing up from Africa or the wilds of rural Indiana, even.)

The phrase in the middle of that paragraph, "…an image that looks like the image…" is the key to how it works its magic, and why it sucks.

The Magic
Here is a two-by-two grid of green blocks and orange-y blocks. Let's assume these blocks represent four single picture elements (pixels), and that your computer monitor displays 100 pixels per inch, so these four blocks will occupy a mere 1/50" square on your screen. That's a tiny speck and you won't notice if, instead of two green and two orange-y pixels (middle box, below), it's just a single four-pixel greenish speck (right box).

That's the magic of JPEG — it substitutes larger groups of pixels of a single color to replicate how our eyes perceived that same area; how our eyes melded those disparate pixels, too tiny to resolve individually, into a single hue. Nice! And by substituting these larger, melded-color, super-pixels for the individual pixels of the original, it takes fewer computer bits to store and transmit the image. Right here, with no other JPEG shenanigans, we've reduced the file size by 75%! What's not to like?

The Suck
The problems with JPEG fall into three main areas: loss of detail, loss of color fidelity, and the permanence of those losses.

On average a JPEG looks fine when viewed on a computer screen if you don't zoom in on it. If you do zoom in, you'll likely see the super-pixels and a commensurate loss of detail due to those super-pixels having replaced the greater number — and thus greater resolving power — of regular pixels.

Here's a 200 x 200-pixel grid of blended colors, with each of the 16 internal squares being 50 pixels on a side. Then that grid was reduced to 10% of its original dimensions as a JPEG, then returned to its original size to show what happened when it was attacked by, I mean, converted to JPEG.

It looked fine when it was small, but note all the stripes and blocks of colors that were the result of making the file size smaller. If you are never going to need that little file to be viewed or printed or projected larger than when it was small, everything will probably be okay. But as the enlarged version shows, if you (or people to whom you hand the JPEG) have to enlarge it for a brochure or a poster or a trade show graphic, those artifacts are unsightly — and permanent. Here's a close-up.

Further, if you open a JPEG in a program such as PhotoshopElementsLightroomGIMPPaintShop ProPaint or others and make changes then save it again as a JPEG, the algorithm will re-jigger the pixels/super-pixels to again "optimize" the file size. The result? Further degradation. Ugh!

And I won't get into pixels-per-inch any more than to note that printing an image in a brochure or poster requires three times the pixels-per-inch as viewing that image on screen. As a test, if you want to see how your favorite little JPEG will look in your next product card, zoom to 300% on your monitor and see how it fares. Great? Meh? Horrible?

For comparison of something more meaningful than color blocks, here's an above-and-below of an TIFF and a JPEG of the same nice gentleman.

What to Do
If you have a JPEG image that you like and plan on using in the future, if possible open it with an image editing app (see above for a few) and save the file in a format that doesn't add artifacting, such as TIFF or PSD. Use that file as your master for creating copies, even JPEGs, in the future. Converting to a TIFF or PSD does not erase the artifacts that were already present, but at least you won't be adding new ones.

In the imaging editing app, you should find settings that affect how much the file size is reduced when saving a JPEG. Understand that the smaller you make the file, the higher the incidence and obtrusiveness of the artifacts. At the highest quality settings, the file size may not be significantly reduced, but the details and colors will remain closer to the original. The reverse is, of course, true — at the highest compression setting (the smallest file size), the more the details and colors will be damaged.

It's this adjustability that leads to JPEG being the go-to format for transmitting even very high quality images by vendors. So don't be surprised if you receive a JPEG from a photographer or stock photo house, but do save it to TIFF or PSD once you receive it and, again, use that as your master.

As an analogy, consider TIFF and PSD files to be your recipes and JPEGs to be the finished dish. (Well, it's not a great analogy, since you can't be served a dish at a restaurant and then turn it back into ingredients, but work with me!) The point is, use JPEG only as a final file format for transmitting over the internet (email, too). The graphics people, in-house or vended or magazine, will thank you.

Summation
I never use JPEG files, except for when I do. Then I create them at the end of the process with quality settings that are optimized for the downstream tasks, always retaining the non-artifacting master files.

P.S.
I was looking more closely at the green-and-orange-y art, above, and realized that when I created the graphic — as a JPEG for this article — not only did the JPEG process average out the green and orange-y colors to make the tiny, greenish, four-by-four super-pixel, it added a constellation of lightly colored pixels to the left of the four-by-four greenish pixels, an area that should have been pure white. Below, on the left, is a close-up of the left side of that post-post-JPEG graphic. You see the greenish center pixels and, faintly, pixels that were added during the conversion. To highlight them, I darkened and exaggerated their colors, shown at right. If what should have been a blank white field had been just white, the darkening I applied for this demonstration would have been just a solid gray field.

Admittedly these stray pixels are difficult to see against the white field, but a graphic artist, using a JPEG as a starting point, might easily run into difficulties in modifying the image if additional chrominance, reduced luminance, or increased contrast figure into their adjustments. I'm telling you, JPEG sucks!


Comments

No comments posted.
Loading...

Archive
January February March April May June (2) July (2) August (1) September October (2) November December (1)
January February March (2) April May June July August September (6) October (15) November (2) December (2)
January (2) February (2) March (2) April (2) May (2) June (3) July (2) August (1) September October November December
January February (1) March April (1) May June (2) July August (1) September (2) October November (1) December
January February March April May June July August September October November December
January February March April May June July August September October November December