Image compression artifacts are the obvious flecks, blobs and chunks that are inconsistent with the original image. These artifacts are the result of too much image compression and/or repeated compression of the same image file.
To understand image compression artifacts requires an explanation of image compression. Let’s start with a raw digital photo that is crisp and clear and too large. This is a raster image, as opposed to a Vector image, since it is the result of an array of pixels instead of mathematically defined shapes, curves, lines and colors. Raster images are images like photographs and vectors are images like clipart.
Since the photo is too large it needs to have smaller dimensions. Let’s say we’re reducing the photo from 3000 pixels wide and 2000 pixels tall to 300 pixels wide and 200 pixels tall. Since a raster image is an array of pixels, we need to remove 4,940,000 pixels to end up with only 60,000 pixels. This is not compression, simply image size reduction. But, it does affect the final image since we are relying on a graphics program to decide which pixels to remove for us. It’s not perfect, but better than doing it by hand. The experts have done a good job with doing this for us.
Disregarding the image reduction process as a role in image quality loss, and assuming our photo is as good as it gets for our new dimensions, let’s review what happened to get to the new size. Removing pixels was required to get to the new size. Pixels were not removed randomly. As pixels were removed, and as remaining pixels collapsed torture, remaining pixels had to be adjusted to most closely match the original image. The removed pixels with their color data are lost forever, excepting the undo option.
Image compression is a process of removing pixels from an image in a way that they can be returned to the image, at least fairly close to what was there before. The purpose of image compression is to remove pixels to reduce the image file size. How many pixels we remove is in relation to how small the file size should be balanced against how good or crappy we can accept the final image appearance. The smaller the file size targeted, the crappier the image will be. The real target is typically a decent looking image quality with an acceptable file size for speedy downloading. Our preference is around 65% in Photoshop and around 85% in Flash. It’s also dependent on the image content, such as a bland gradient versus a crisp photo of a stucco wall with a lot of detail.
Image compression has a number of options not generally recognized or understood. You can control more than the file size/quality balance. There are different methods for determining which pixels to remove and the resulting set of pixels in the compressed image. The method choice is part if the CODEC (COmpression-DECompression), which is tagged into the image file to be used during decompression so the removed pixel data can more efficiently be returned.
The compression process is the startvof image quality degradation and too much compression removes more pixels than can reasonably be replaced during decompression. There is a point of no return during compression, which means it’s better to err on the side off too large a file size than too small. Consider the array of pixels in rows and columns. As long as the gaps between pixels aren’t too large, the pixels surrounding the gap can guide the software doing the decompression. When the gaps get too large, the decompression software starts to have trouble figuring out what pixels to recreate.
Figuring out what pixels to recreate in a compressed image during decompression is called pixel interpolation. “Interpolation” is not an image-specific term, and means the determination of missing information between two points using the surrounding points as guidance. The opposite is extrapolation, which is determining missing data outside two or more points using those points as a guide.
Image decompression with insufficient pixel data results in an area in the image that is inconsistent with the original image. The bigger the gaps, and the less information to interpolate with, the crappier the areas look where pixel data I recreated. These areas look like blurry, blocky, grungy areas that stand out.
Now consider repeated compression of the same compressed image discussed above. When the image is opened and decompressed, the image software is starting with guesswork pixel data mixed with original pixel data. Unless the image software is exceptional and tracks which pixels are original and which are fabricated, the next compression process will surely remove original pixels to reduce the file size.
This verges on catastrophic for the image quality. An image with a small amount of compression may be decompressed with a small amount of compression and not degrade too quickly. The right and wrong amounts of compression and how many layers of compression are tolerable are simply gauged by how good or crappy the image looks. If a compressed image is reduced to smaller dimensions, it deceptively gains image quality and can be re-compressed fairly efficiently.
Given this knowledge of compression, decompression, and the accumulation of image compression artifacts, let’s return to the subject of image dimensions changes and image compression artifacts. If you make the dimensions larger than the original, the same image decompression process occurs by spreading out the original pixels and then interpolating pixel data to fill in the new gaps. We may have started with an original, crisp image, but by expanding it first, it’s the same as starting with a compressed image since there are gaps in the pixels that require interpolation to fill them in.
Whether starting with compressed or expanded images, image artifacts accrues with the amount of compression, the amount of expansions, and how many times these processes are repeated. Unless there are no available options, a good graphic designer always returns to the original or best quality available image possible.
Want to see this in action for yourself? Take any crisp thumbnail image and expand it to some large size like 10″ wide. You’ll see image artifacts immediately.