JPEG compression loses some data in the encoding process. In JPEG compression, the image gets divided into small bolcks of 8 pixels by 8 pixels. Each 8x8 block is run through a discrete cosine transform. Once the image is in the frequency domain, the coefficients get rounded off to reduce the size of the resulting file. Because of the rounding, the reconstituted image is never exactly the same as the original. It has some visual artifacts, which may be nearly invisible, or may be flagrantly obvious, depending on the original image and the amount of compression (and thus, rounding) done to the image.

Most of these artifacts appear where there is a sharp edge between light and dark in an image. Imagine (or if you're really into this sort of thing, make) a jpeg image of a black and white checkerboard, rotated 45 degrees so that the lines in the grid don't line up with the compression blocks. If you look closely, you can see a visual "echo" of the line a few pixels away from the real line. Since compression is done seperately on the each YUV channel seperately, (see converting RGB to YUV for more info on what the Y, U, and V channels are) the "echo" may look like a faint rainbow that runs parallel to the real line. There may also be a generally "fuzzy" look to lines that should be hard and sharp. An image that goes from white to black in the space of one or two pixels has a very high frequency over that area, and since representing high-frequency information takes a lot of bits, these high frequency spikes sometimes get chopped off by overzealous compression algorithms.

The moral of this story? Don't crank your JPEG compression way up! :-) Image quality will suffer. Oh, and use PNG (not GIF, they have other problems)!) for line art or things with only a few colors. JPEG is best suited to photos and full-color digital artwork.

It has been over fifteen years since the above write-up, and jpeg artifacts are still with us. In fact, jpeg artifacts have increased in some places, and along with being a technical phenomena, as described above, they also have taken on a social meaning.

It is somewhat surprising that images with jpeg artifacts continue to be shared across the internet, given the technical improvements in both storage and bandwidth in the past decade and a half. In 2000, dial-up internet was still standard and hard drive sizes averaged a few gigs at most, so keeping images under 100k made sense. 100k equalled a 20 second download time at 5/k a second, and that meant a page with three images of that size on it would take a minute to load. Given those limitations, it makes sense to put up with a little blurring in our images. But now, when download times can be hundreds of times faster and hard drives a thousand times as spacious, why are heavily artifacted jpegs still floating around?

Like so much, social media, specifically Facebook, happened. Facebook's photo page autocompresses uploaded photos. With some pictures, such as pictures of people and landscapes, this doesn't matter, because the compression naturally blends colors. But with other pictures, especially with so-called "memes" that include writing, it is rather obvious. Captions on memes often have colored writing on a white background, something that is prime territory for artifacts. Artifacting has taken on a certain political and social meaning as well: there seems to be a link between the banality, triteness and simple-mindedness of a meme and the badness of the artifacting of the image.

Along with this, artifacting can also be used intentionally, as compressing images can sometimes give images a dreamy, unreal quality that has some artistic merit in it. Along with this "serious" artistic use, jpeg artifacts can also be used "ironically" as they were masterfully in the webcomic Sweet Bro And Hella Jeff.

Log in or register to write something here or to contact authors.