All posts

What are JPEG artifacts? A visual guide to compression damage

What JPEG artifacts are, why they happen, and the four types you see in compressed images: blocking, ringing, color smearing, generational loss.

May 24, 20267 min readBy Andy Feliciotti

What are JPEG artifacts?

JPEG artifacts are the visible distortions left behind when an image is compressed using the JPEG format. They show up as blocky 8×8 squares, halos around sharp edges, color smearing near saturated areas, and a general loss of fine detail. The lower the quality setting, the more obvious they get.

If you have ever seen a photo with chunky squares around someone's face, faint fringing around text, or the "deep-fried" look that internet memes acquire after years of resharing, you have seen JPEG artifacts.

Why JPEG produces artifacts at all

JPEG is a lossy format. To shrink an image's file size, it deliberately discards information your eye is least likely to notice. The encoder makes hundreds of small approximations per image, and at low quality settings those approximations stop being subtle.

The format was published in 1992 as ISO/IEC 10918-1 (also known as ITU-T Recommendation T.81), based on a proposal from the Joint Photographic Experts Group. The reference paper by Gregory K. Wallace, The JPEG Still Picture Compression Standard (Communications of the ACM, 1991), describes the full pipeline.

How the JPEG encoder works

This is the short version. For the full walk-through with worked DCT examples and quantization tables, the JPEG compression explainer has the detail.

Every JPEG file is the result of the same five-step process:

  1. Color conversion. RGB pixels are converted to Y′CbCr (one luminance channel plus two chroma channels). Your eye is much more sensitive to brightness than to color, and this split lets the encoder treat each separately.
  2. Chroma subsampling. The chroma channels are usually downsampled at a 4:2:0 ratio (one chroma sample per four luma samples). This alone roughly halves the chroma data with very little perceptual cost.
  3. Block split. Each channel is divided into 8×8 pixel blocks. Every block is then processed in isolation, with no knowledge of its neighbors.
  4. Discrete cosine transform (DCT). Each block is converted from raw pixel values into frequency coefficients. Low-frequency coefficients describe broad color shifts; high-frequency coefficients describe fine detail like edges and texture.
  5. Quantization. Each coefficient is divided by a value from a quantization table, then rounded. This is the only lossy step in the entire pipeline. The "quality" slider in your image editor is just a knob that scales this table.

A final Huffman encoding pass losslessly packs the result into the file you save.

Every artifact you see is downstream of one of these steps.

The four artifacts you actually see

Blocking

The encoder works on independent 8×8 blocks, so the pixel values at one block's edge are not coordinated with the next block's. At low quality settings, the rounding from quantization shifts edge values just enough that the block grid becomes visible as a checkerboard of slightly mismatched tones. Smooth gradients like clear sky, out-of-focus backgrounds, or skin show it first because those are the regions where any discontinuity becomes obvious.

Ringing (also called mosquito noise)

Sharp edges, like black text on a white background or a building outlined against bright sky, contain very high spatial frequencies. JPEG's quantization is harsher on high-frequency coefficients, so the encoder approximates those edges with too few sine waves. The result is "ringing": faint ghost lines parallel to the edge, plus a halo of noise around it. The effect is called "mosquito noise" in video because the pattern shifts frame to frame, as if a small swarm is following the edge around the screen.

Color smearing and banding

Chroma subsampling cuts color resolution to a quarter of luminance resolution. At reasonable quality your eye does not notice. At low quality, fine color detail gets smeared across larger regions, saturated areas like a red shirt or a neon sign bleed into surrounding pixels, and subtle gradients collapse into visible bands instead of smooth transitions.

Generational loss

Save a JPEG, open it, edit it, save it again. The encoder runs the entire pipeline again, including a new round of quantization. Each pass rounds slightly differently than the last, and the small errors stack. After many generations the artifacts compound, and you end up with the heavily-degraded look of a meme that has been emailed around, screenshotted, and reposted hundreds of times.

The dedicated post on generational loss walks through how the math eventually converges and what gets lost first. For the cultural side of pushing this effect on purpose, see the deep-fried meme guide.

When artifacts show up

Three situations make artifacts worse:

  • A quality setting below roughly 60 on the libjpeg 0–100 scale (or below 6 in Photoshop's 0–12 scale) starts producing visible damage on most photos. The quality settings guide covers exactly which numbers to pick for which use case.
  • Repeated saving compounds loss, because every save runs quantization again. Editing apps that re-encode on every action accumulate damage quickly.
  • Photographic content survives JPEG reasonably well, but screenshots, line art, and text suffer disproportionately. The format was designed around the assumption of smooth photographic gradients.

How to avoid them in the first place

A few practical rules cover most cases:

GoalWhat to do
Photo for the webJPEG at quality 75–85, or WebP at quality 80 for smaller files
Photo for archivalKeep the original RAW, or save as PNG or TIFF
ScreenshotPNG or WebP lossless. Never JPEG.
Logo or line artSVG if vector is available, otherwise PNG
Maximum-quality JPEGQuality 90+ with 4:4:4 chroma if your encoder exposes the option

If you have a master file in a lossless format, edit only from that copy and export a JPEG at the very end. Treat every saved JPEG as a one-way conversion. The format comparison post covers when each alternative is the right call.

How to remove artifacts that are already there

You cannot truly recover lost information. The data is gone. But you can often hide the damage. The approaches range from a Photoshop JPEG Artifacts Removal filter (a denoise pass plus selective blur) to AI-based models like FBCNN or commercial tools like Topaz Photo AI, which try to reconstruct plausible detail. None of these produce the original; they produce a plausible guess.

We have a dedicated walkthrough: how to remove JPEG artifacts from an image.

If you want to add artifacts on purpose, that is what the JPEG Artifact Generator is for.

FAQ

Are JPEG artifacts the same as image noise?

No. Noise is random pixel-level variation, usually from the camera sensor. Artifacts are deterministic patterns introduced by the encoder. They follow the 8×8 block grid and tend to concentrate near edges and in low-frequency regions.

Will turning the quality slider up make existing artifacts disappear?

No. Once an image has been saved as a JPEG at low quality, the lost information is gone. Saving the same file again at quality 100 just preserves the existing artifacts at higher fidelity.

Is PNG always better than JPEG?

For photos, no. PNG is lossless, but a typical JPEG at quality 85 is 5 to 10 times smaller than the equivalent PNG with no visible difference. For screenshots, text, and line art, PNG is usually better because there are no compression artifacts at all.

What does the JPEG quality slider actually do?

There is no single standardized scale. Each encoder defines its own. Photoshop uses 0–12, libjpeg uses 0–100, and Adobe Camera Raw uses 1–12. The same numeric "quality 80" in two different tools is not the same setting. What the slider really controls is a scaling factor applied to the quantization table; the number on the UI is an abstraction over that.

How does JPEG XL fix this?

JPEG XL is a newer format finalized in 2022. It can re-encode existing JPEG files losslessly (roughly 20% smaller, decoding to a byte-perfect copy of the original), and for new images it offers both lossy and lossless modes with substantially better quality at the same file size. Browser support is uneven: Safari ships it, Chrome and Firefox do not as of this writing.

Why are some compression patterns called "deep-fried"?

The term traces to internet meme culture around 2017. "Deep-fried" describes the cumulative look of an image that has been through many generations of low-quality JPEG re-encoding, often with added saturation and contrast on top. It became an aesthetic in its own right, and tools now exist to produce the look intentionally. The deep-fried meme guide covers the cultural history and how to make one. JPEG damage is also one of several techniques in the broader glitch art toolkit.

Sources

Want to see artifacts in action? Try the JPEG Artifact Generator. Drop in any image and watch the artifacts appear as you turn the quality down.

Keep reading