JPEG Artifacts: Why Photos Look Blocky
What JPEG artifacts are, why blocky edges and color banding appear after compression, which quality settings avoid them, and how to fix them.
By Ahsan Khowaja (CEO) · · Updated · 8 min read
Facts checked against official sources on
On this page
JPEG artifacts are the flaws you see when a JPEG has been compressed too hard: small square blocks, smudgy halos around edges and text, and stepped bands of color in smooth areas like skies. JPEG saves space by throwing detail away, and a lower quality setting throws away more. A finished file can't be fully repaired. So the work is prevention. Compress from the original, resize before you lower quality, save as few times as you can, and keep screenshots and graphics out of JPEG altogether by using PNG or WebP.
What do JPEG artifacts look like?
Zoom in on a heavily compressed JPEG and you will usually find one or more of these:
| Artifact | What you see | Where it shows most |
|---|---|---|
| Blocking | A grid of small squares, especially in flat or gently shaded areas | Skies, walls, skin, dark shadows |
| Ringing ("mosquito noise") | Faint ghost lines, halos or speckles next to sharp edges | Text, logos, line art, building edges against sky |
| Banding | Smooth gradients turn into visible stripes or steps | Sunsets, studio backdrops, blurred backgrounds |
| Color bleeding | Colors smear slightly beyond the edges of objects, especially strong reds | Red text, colored logos, fine colored patterns |
| Loss of fine texture | Grass, hair and fabric look smeared or "painted" | Detailed natural textures |
A well-compressed photo shows none of this at normal viewing size. Trouble starts when an image is compressed aggressively, saved several times, or shown larger than it was meant to be.
Why do JPEG artifacts happen?
JPEG is a lossy format. It discards information it predicts you will not notice. MDN's image format guide calls it "the most widely used lossy compression format for still images", based on the discrete cosine transform (DCT), and warns that lossy compression on "content requiring sharpness, like diagrams or charts, can produce unsatisfactory results".
Those flaws aren't random noise. Each kind in the table traces back to one of three steps in the JPEG standard itself (ITU-T T.81, also published as ISO/IEC 10918-1), which is why they look the same in every program.
1. The image is split into 8 × 8 blocks
In the standard's words, the samples "are grouped into 8 × 8 blocks, and each block is transformed by the forward DCT" into 64 values. Each block is compressed on its own. It knows nothing about the block next to it. Under strong compression, neighboring blocks stop matching at their borders and the grid shows.
That is blocking.
2. Detail is rounded away
Each of the 64 values is then "quantized using one of 64 corresponding values from a quantization table". Quantization is rounding, and the fine-detail values get rounded hardest. Your editor's quality setting controls how coarse the rounding is.
Too coarse, and a sharp edge can no longer be described exactly, which leaves ringing beside it. Gentle gradients collapse into bands for the same reason. A sky needs many slightly different values, and rounding leaves it only a few.
3. Color can be stored at lower resolution
JPEG files in the common JFIF format store color as YCbCr: one brightness channel (Y) and two color-difference channels (Cb and Cr). The standard lets each channel have its own sampling resolution. Encoders commonly keep brightness at full resolution and store color at reduced resolution, because our eyes are less sensitive to fine color detail than to fine brightness detail.
We use the sharp library, and it defaults to 4:2:0 chroma subsampling for JPEG output. That keeps color at half the width and half the height of the brightness channel. Photos survive it well. Small red text and thin colored lines come out fuzzy, and that is the color bleeding in the table.
Our guide to lossy vs lossless compression explains the wider trade-off, and how image compression works walks through it in plain English.
Which JPEG quality setting should I use?
Nobody can give you one number, and anyone who says "always use 80" is skipping a problem. Quality numbers differ between programs: "quality 80" in one tool is not the same as "80" in another. So I can only give you figures for our own pipeline.
PictureToLink's uploader uses the sharp/libvips image library with its mozjpeg encoder settings turned on. Its three presets set the JPEG quality like this: High quality is 85, Balanced is 75 (the default) and Smallest file is 65.
We ran three of our test photos through each preset. Uploads are stored at up to 1920 px on the longest side, so all three came out 1920 px wide whichever preset was used.
| Sample photo | Original | High (85) | Balanced (75) | Smallest (65) |
|---|---|---|---|---|
| Flowers, 3000 × 2000 | 985 KB | 504 KB (48.8% smaller) | 370 KB (62.4% smaller) | 301 KB (69.5% smaller) |
| Landscape, 4032 × 2623 | 390 KB | 121 KB (69% smaller) | 84 KB (78.4% smaller) | 67 KB (82.9% smaller) |
| Portrait, 3024 × 2016 | 1.65 MB | 575 KB (65.1% smaller) | 374 KB (77.3% smaller) | 271 KB (83.5% smaller) |
Start with the High column. Even there the photos came out 49–69% smaller than the originals, and quality had little to do with it. They had been scaled down to 1920 px. Most of the saving comes from the smaller dimensions.
Each step down in quality then saves a further fifth to a third. By byte count, Balanced (75) was 27–35% smaller than High (85), and Smallest (65) was another 19–28% smaller than Balanced. Lower settings mean coarser rounding, so they are also where artifacts get more likely.
Resizing beats both steps. In the same test, saving the portrait 800 px wide instead of 1920 px, still at Balanced, made it 92.6% smaller again (27,693 bytes instead of 374,012). The landscape came out 73.7% smaller. Neither needed a lower quality setting.
A large, dark, noisy photo shows the size limit at work even more clearly. Our 5000 × 3333 night street scene (2,282,830 bytes) came out 92% smaller at High, 95.2% at Balanced and 96.5% at Smallest. Most of that is the pipeline scaling it down: at 1920 × 1280 it keeps about 15% of the original pixels.
So my answer is to shrink the picture first and leave quality in the middle. If the file is still too big, make it narrower before you touch the quality setting.
These figures are file sizes only. We did not score visual quality with a metric, so I can't call any setting artifact-free. It also depends on the picture. A detailed landscape hides artifacts far better than a clear blue sky or a screenshot with text.
Why does re-saving a JPEG make it worse?
Every time a JPEG is opened, edited and saved as a JPEG again, it goes through the lossy steps again. Errors from earlier saves get compressed too, and the damage builds up. This is called generation loss. Memes and screenshots that have been shared and re-uploaded many times are the usual example.
It often happens without you noticing. You edit a photo over several sessions and save as JPEG each time. Or you download an image from a chat app, which already compressed it, and upload it to another service that compresses it again.
Any service that re-encodes images adds a generation, and that includes ours. PictureToLink re-encodes every upload to strip metadata and compress it. For a JPEG that has already been compressed heavily, choose the High quality preset to keep the extra loss small.
How do I avoid JPEG artifacts?
- Go back to the original. Compress from the highest-quality source you have, never from a copy of a copy.
- Resize first, then compress. Shrinking a 4000-pixel photo to the size it will be displayed at removes far more bytes than lowering quality, and smaller images hide artifacts better.
- Keep quality moderate. In our measurements above, most of the saving on camera JPEGs came from resizing. Very low quality settings save a little more at a visible cost.
- Edit in a lossless format. If you will work on an image over several sessions, keep the working copy as PNG or in your editor's own format, and export to JPEG once at the end.
- Check at 100% zoom. Look at skies, faces and text before you publish.
You can try settings on your own photo with our image compressor. It runs in your browser and shows the file size before and after. Its quality slider goes from 30% to 95%, so you can find the lowest setting that still looks clean.

Quality 75 at 1920 px: the flower photo shrank by 57% in the browser.
Can I remove JPEG artifacts from a photo?
You can reduce them. You can't reverse them, because the discarded detail is gone.
People often try re-saving the damaged file at a higher quality setting. That doesn't work. A high setting does not restore detail in a damaged image. It only stops further loss, so re-save at higher quality only after cleaning the picture up.
If the original is lost, two things do make a visible difference. Display the image smaller, since downscaling makes the 8 × 8 blocks much less visible. Or run a gentle noise reduction or "JPEG artifact removal" filter in a photo editor. These smooth out blocking and ringing, at the cost of some softness.
When should I use PNG or WebP instead?
JPEG was designed for photographs. For other kinds of image, another format avoids artifacts entirely or gives a smaller file at the same quality.
Screenshots, text, charts, logos and line art belong in PNG, which is lossless, or in WebP. These are the sharp-edged images MDN's warning is about. In our measurements, a 1366 × 900 PNG screenshot shrank from 2.38 MB to 730 KB with lossless PNG optimization (our Balanced preset), and to 108 KB when converted to WebP.
For photos on the web, consider WebP. MDN notes that lossy WebP images are "on average 25–35% smaller than JPEG images of visually similar compression levels", and Google's WebP documentation gives 25–34% at equivalent SSIM quality. Averages hide a lot, though. In our test, with both versions stored at 1920 px at our Balanced setting, the landscape photo was 34.5% smaller as WebP than as JPG, but the portrait was 51% larger as WebP. Check your own file.
Pictures you will post on Reddit are a simpler call. JPG, PNG and GIF are the safest formats to upload there, so a PNG screenshot can stay a PNG. Our guide to posting images on Reddit has the steps.
Images that need transparency have no choice: PNG or WebP, since JPEG does not support an alpha channel.
