ASCIi Group
JPEG Foibles
by Bill Funk
May 13, 2001
[In this article, when you click a link to an image, the images are shown in a separate window or tab. You can then switch between the articles and images.]
At the main meeting in May, we talked about how saving an image file using JPEG (.jpg) can make an image look worse than you expect. Or, put another way, JPEG is a LOSSY compression method, meaning you will lose image information. I have done a small example of the difference that compressing using JPEG can do to an image.
The images shown are:
-
MASTER.png,
the original image
used for these comparisons
-
LOWCOMP.jpg,
the master file
saved using JPEG
set to the lowest compression format
-
HICOMP.jpg,
the master image
saved using JPEG
set to the highest compression factor
- HICOMP.png, which is HICOMP.jpg resized back to the same size as the original MASTER.png, so you can see the results of the higher compression losses at normal viewing size.
All these images are from the same original photo, taken with an Olympus D-600L camera. The original is a picture of a flag on the top of a ship's mast. The original picture is as it came out of the camera which was a 1280x1024 JPEG image file. These images have been cropped from the original photo and the resulting images were saved in JPEG format using two very different compression factors. They were then resized to 4 times their original size.
As you can see, there is a huge difference between the two images. LOWCOMP.jpg is the file saved using the lowest compression factor, while HICOMP.png was saved using the highest compression factor. All image manipulations were done using Paint Shop Pro 7 (which I will call PSP from here on) on my desktop system.
In the original image, MASTER.png, you can see the image the two JPEG files came from. It's small, because it was cropped from a much larger image. It is the same image as LOWCOMP.jpg, but original size. As you can see, it's very clear, and the JPEG compression as it comes from the camera still leaves a very clear image that almost rivals a 35mm print.
In LOWCOMP.jpg we can see that there are several flaws in the image, especially in the edges of the flag on the blue sky, and in the sky itself, which should be a very smooth blue, but is broken into a blotchy, multihued background. This is the way the image came out of the camera. A look at the master image will show that at a normal viewing size, the blotchiness really doesn't show up much at all. These imperfections that JPEG introduces into an image are called artifacts.
HICOMP.png was saved using the highest compression factor available in PSP, and it really shows. The blue sky is no longer blotchy, because all detail except the color has been lost. While this may seem to be a good thing (a look at HICOMP.png shows this image sized the same as the MASTER.png image) we also see the loss of detail in the flag and mast. Note that the rigging that's plainly visible in LOWCOMP.jpg is also gone. The pieces of mast that are in the image have also changed color from brown to purple, and there's a purple fringe on almost everything in the picture. Detail loss is also seen in the blocky way everything is shown. There is so much detail gone that a print of this image file would be acceptable only as a conceptual art piece. At this compression ratio there are so many artifacts that the image can't be printed with any expectation of looking good. Even using an image this bad on a website would not be a good idea.
The difference in the image quality is extreme in my example to show the results of a lossy compression scheme such as JPEG. The high compression factors that I used in HICOMP.png aren't used most of the time, but the higher the compression factor that's used, the more artifacts are introduced, and the worse the image looks. If you intend to print your images, this is even more important to remember; a printed image shows flaws in an image much more than the monitor does.
Please don't get the wrong idea; JPEG format has its place, and it will be around for a long time. Most digital cameras use JPEG as the format to save their images, because a raw (or, usually, TIFF) file that would have no loss of data would be many times the size of a JPEG file that, for all intents and purposes, looks just as good. But we need to be aware that every time we save an image using JPEG, some compression is done, and details disappear forever. When using an image manipulation application (such as Paint Shop Pro, or any of the others out there), we shouldn't use JPEG to save work in progress. Pick something like PNG or any of the other lossless formats so only the changes you want are made to the images.



