Why Should I Care About Image Compression?

Ignorance is bliss. Am I right? Well, maybe. If you do anything with images and computers, that bliss may be causing your images to look…well, lousy. The problem may be the compression of the file that happens every time you save it. Are you interested in knowing how to keep your images looking crisp and sharp? Read on, my friend.

Image 1 – First JPG

When you save a pixel-based file, part of the process is to compress the file – to squash it down to a smaller size. There are two main types of compression when it comes to image files: lossy and lossless. With lossy compression, some of the pixels are discarded every time you save that file. This makes for a smaller file, but it degrades the quality of the image. JPGs are a great example of lossy compression. Check out the first image. It is a JPG created specifically for the web – sized to 300 pixels by 200 pixels, at 72 ppi (pixels per inch).

Image 2 – JPG’d three more times

Pretty image, eh? Everybody sigh. Okay back to our discussion. If you were to open that image and add some text and save it again, more pixels are discarded and the image is more degraded. And then the next day you decide to edit the text and save the file again. I bet you know what happened. Yup, more degradation in quality. Every time you save a jpg, it tries to compress it more and throws more pixels out the window. Check out the artifacts on the second image. It was saved three more times at a medium setting. Images 3 and 4 are zoomed in on the most damaged areas – the edges of contrast between the swan and the background.

Image 3

Image 3 is a close up of the swan from the first JPG, and the same area after the image was saved three more times. You can clearly see a ring of darker pixels around the head and neck. These are called artifacts. Artifacts are one form of quality degradation that occurs every time you save. I used to tell my graphic design students, “Don’t JPG a JPG!”

The other thing lossy compression will do is cause banding in large areas of colour gradation, like a blue sky. Instead of the sky being a smooth gradation, lossy compression will result in bands of blue across the sky. You’ve probably noticed this on some of your images.

The other type of compression is called lossless. With this type, there will be no throwing the pixels out the window. The main issue with lossless is that the files can be quite large.

If you are working with a file format that uses lossy compression, then as soon as you get the file save it using a lossless format and keep that as your original. Do your work in that format and continue to save in the lossless format – I call this file my master file. Only when you are ready to publish/share the image, save in a lossy format if you must. If you need to edit the work again, always go back to the lossless master version and create a new publish-version (lossy) of the file.

If you are unable to work with anything but lossy files (JPG, for example), then preserve the first generation of the file, call this the master. Save any changes with a new name. For example, save the original as sunset_master.jpg and your edited version as sunset_verson1.jpg. If you need to edit, it is best to go back to sunset_master and redo your work, saving the result as sunset_version2.jpg. This way you limit the number of pixels that are thrown away. Also, if possible, save at the highest quality setting as that that limits the damage done with a save.

I suppose you are wondering what file formats use lossy and lossless compression. The good news is that vector formats do not use pixels, but rather display is based on geometrics or mathematical formulas. So most do not use compression when saving. That leaves us with raster file formats. Let’s look at the most common types of rasters. Lossless (no pixels out the window) compression is applied to TIFs, GIFs and PNGs. Lossy compression is used on JPGs. PDFs straddle both worlds. On vector content, it won’t apply lossy compression, but on any raster content it will use the same compression that’s applied to JPGs. Choosing “high quality” will compress the file so as to allow quality printing on a desktop printer. Choosing “press quality” is for commercial printing (professional print shop that generates separate plates for the printing colours CMYK) – not much compression at all. Looking at this list, you might be tempted to save all your images as GIFs and avoid the whole compression-destruction thing. There are really good reasons not to do that! Take a gander at JPGs, PNGs, and GIFs, oh my!

The bottom line is that you want to keep a master file that does the least amount of damage and loss of digital information. Even in taking photographs with a camera, the same principle applies. Compression/file format is one aspect of preserving quality. The other consideration is the colour space. If you don’t want to throw pixels out the window, you probably don’t want to flush colours down the…sink. (Heeheehee. You thought I was going to say toilet!) If you want to learn a bit about what colour space to use, check out How Big Should My Crayon Box Be?

Here’s a handy and free Image Format Cheat Sheet.

Leave a Reply

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