Why JPEG Loses Quality: Artifacts, 8×8 Blocks and Compression Settings
You open a photo and it's covered in tiny squares, there's a murky halo around the text, and a clear sky has turned into stripes. It isn't a corrupt file or a bad camera — it's how JPEG compression works. Let's walk through exactly what the format throws away from your image, why you can see it, and how to set up saving so the artifacts never show.
The short answer: why the image falls apart
JPEG is a lossy compression format. Unlike PNG, which keeps every pixel exactly, JPEG deliberately throws away part of the information in an image to make the file smaller. The bet is simple: the human eye misses a lot, so why store what nobody can see?
The catch is that the eye misses those losses only up to a point. Push the compression harder and what was thrown away starts to show: instead of a smooth picture you get squares, murky halos and stripes. These are compression artifacts. They don't "decay over time" or "glitch out" — they are baked into the file the moment you save, and the only way to undo them is to re-save from the original.
The key idea
JPEG doesn't "lose quality on its own." It gives up exactly as much quality as you allow it to with the compression slider. This whole article is about how it does that, and where the line between "invisible" and "now you can see it" actually falls.
Step 1: JPEG cuts the image into 8×8 blocks
The first thing a JPEG encoder does is split the image into a grid of 8×8-pixel squares. Each block is then processed completely independently of its neighbours. That's the crucial detail: JPEG never sees the picture as a whole — it sees thousands of little squares and compresses them one at a time.
Inside each block it runs a piece of math called the Discrete Cosine Transform (DCT). It sounds intimidating, but the idea is simple. The DCT describes a block not as 64 separate pixels, but as a sum of "waves" of different frequency: gentle shifts in brightness are "low frequencies," while tiny sharp details are "high frequencies." In effect, the format translates the picture from the language of "here are the pixel values" into "here are the waves it's made of."
An analogy
Think of an 8×8 block as a musical chord, and the DCT as splitting it into individual notes. Low frequencies are the bass (the block's overall tone); high frequencies are the faint upper harmonics (the fine detail). Nothing is lost yet — it's just another way to write down the same sound.
Step 2: what gets discarded — high frequencies
The DCT itself is reversible and loses nothing. The losses begin at the next step — quantization. Here JPEG divides every DCT coefficient by a number from a special table and rounds the result. Small values — and those are first and foremost the high frequencies, the fine detail — simply become zeros after dividing and rounding. And those you cannot get back.
Why the high frequencies specifically? Because the eye is least sensitive to them: slightly coarsening the fine texture of grass or skin is something we barely notice, whereas overall shape and color we catch instantly. JPEG exploits exactly this: it sacrifices the detail we "won't miss" and preserves what jumps out. That's also why the format is so good for photos and so bad for text — more on that below.
The strength of quantization isn't fixed. It's set by the quality parameter (its own chapter below): the lower it is, the "coarser" the table, the more coefficients are zeroed out and the more detail is lost. At quality 95 only the most imperceptible crumbs go; at quality 30 you lose half of what made the picture sharp.
The four faces of JPEG artifacts
When compression goes too far, the losses surface as recognizable defects. Once you can tell them apart, you instantly know what went wrong — and what to do about it.
| Artifact | What it looks like | Where it shows most |
|---|---|---|
| Blocking | A visible grid of 8×8 squares | Sky, skin, smooth backgrounds |
| Ringing | Light/dark "ripples" along an edge | High-contrast borders, text |
| Mosquito noise | Shimmering specks near edges | Text, logos, branches on sky |
| Banding | Stair-step stripes instead of a gradient | Sunsets, smooth fills |
Blocking is the most recognizable defect. Because each 8×8 block is compressed separately, under heavy compression neighbouring blocks end up with slightly different average brightness and color — and the seams between them show up as a grid. It's most obvious on even areas: clear sky, skin, a studio backdrop.
Ringing appears at sharp, high-contrast edges. To describe a hard transition precisely you need a lot of high frequencies — exactly what JPEG trimmed. So the edge "rings": a light-and-dark ripple forms beside it, like ripples on water. Mosquito noise is the same ripple, but unstable: it lands differently across blocks, so a swarm of specks seems to buzz around a letter or a branch.
Banding is the curse of smooth gradients. A soft color transition (a sunset sky, a blurred background) needs subtle high frequencies; when quantization zeros them out, the smoothness collapses into a few flat stair-step stripes.
Artifacts are irreversible
Once detail is discarded on save, it's no longer in the file — there's nothing to restore. Denoisers and AI upscalers can disguise blocks by softening them or inventing plausible texture, but they don't bring the real lost detail back. The only reliable fix is to take the original and save it at a higher quality.
Color at half resolution: chroma subsampling
There's one more source of loss few people know about — chroma subsampling. Before compressing, JPEG separates the image into brightness (how light a pixel is) and chroma (its color). This isn't arbitrary: the eye is highly sensitive to brightness and much worse at resolving fine detail in color specifically.
JPEG leans on this and stores color at reduced resolution. In the most common mode, 4:2:0, every four brightness pixels share a single color sample — meaning the color information is halved along both axes. On a photo this is almost invisible: brightness stays full. But wherever a sharp boundary between two colors meets — red text on a blue background, a colored interface — the color "bleeds" past the edge, because it's stored more coarsely than the picture itself.
The quality setting: what to choose
When you save a JPEG, the program asks for a "quality" from 0 to 100. In reality that's a knob for the strength of quantization: 100 throws away almost nothing, 0 throws away everything it can. The important thing is that quality is not linear: between 100 and 90 the difference in file size is enormous while the difference to the eye is near zero. But between 60 and 40 the size barely changes, yet artifacts pile up fast.
The practical takeaway: for photos, stay in the 80–90 range — the best balance of "light file / no visible loss." Going above 95 is almost pointless: size grows quickly with no meaningful gain. And if you're converting an already-saved JPEG, remember — you can't raise quality after the fact: whatever was discarded in the source is already gone from it.
Generation loss: death by re-saving
Here's the scenario that quietly kills millions of photos. You open a JPEG, nudge the brightness, save. Tomorrow you open it again, crop, save again. And so on, a few times over. Each round the picture gets worse — even if you barely changed anything. This is generation loss.
The reason is that every JPEG save is a brand-new full round of lossy compression. The software re-cuts the image into 8×8 blocks, runs the DCT again and quantizes again, discarding detail. Worse: on re-saving, the block grid often shifts and no longer lines up with the previous one, so the format "damages" even the spots that survived last time. The artifacts aren't overwritten — they accumulate, generation after generation, like photocopying a photocopy of a photocopy.
Edit from the original
Keep the source (RAW or the camera's JPEG) and edit a fresh copy of it each time, not the result of the last edit.
Work in a lossless format
While editing, keep the file lossless — PNG or TIFF. That way intermediate saves don't pile up artifacts.
JPEG once, at the end
Compress to JPEG only for the final version, right before publishing. One compression instead of ten — and the photo stays clean.
Save your photo losslessly — while you still have the original
Planning lots of edits, or need crisp text and graphics? Convert JPEG to PNG: a lossless format won't add a single new artifact across future saves. Free, right in your browser.
Convert JPG to PNGWhen JPEG is simply the wrong tool
JPEG is brilliant at exactly the job it was built for — photographs. Smooth tonal transitions, soft textures, no hard outlines: here the loss of high frequencies is invisible, and the file comes out many times lighter than PNG. For camera and phone shots it's the ideal format.
But wherever a picture is made of sharp edges and solid colors, JPEG falls apart — because it discards the very thing that holds such graphics together:
- Text and screenshots. Letters and lines are pure high frequency. JPEG wraps them in halos and mosquito noise, and the text turns grubby. Use PNG.
- Logos and graphics with flat fills. Crisp color borders get smeared by both blocking and chroma subsampling.
- Images with transparency. JPEG can't do it at all — a transparent background turns white. PNG only.
- Files for further editing. To avoid stacking up generation loss, keep intermediate versions lossless.
If instead you want a newer, compact photo format, look at WebP: at comparable quality it's usually lighter than JPEG — try it in the JPG → WebP converter. And when you need to turn a PNG back into a light JPEG for publishing, PNG → JPG has you covered. The full list of conversions lives on the all formats page.
A simple rule for choosing
A photo with no hard outlines — JPEG (quality 80–90). Text, a screenshot, a logo, transparency, or a file you'll edit later — PNG. This one decision saves more headaches than any denoiser.
Frequently asked questions about JPEG artifacts
Read next
BasicsWhat Is JPG: The Format That Conquered the Internet
Where JPEG came from, how it's built, and why it's everywhere.
How-toHow to Compress JPG Without Visible Quality Loss
Shrink the file so the artifacts stay out of sight.
ComparisonJPG, PNG or WebP: Which Format to Pick for Photos
Compared on weight, quality and compatibility.