Troubleshooting
QR code broken by image compression
JPEG compresses in 8 × 8 pixel blocks and adds ringing artefacts at every hard edge — exactly what a QR code is made of. Messaging apps and social platforms recompress every upload, so each re-share degrades the code further. Keep QR codes in PNG or SVG, share the file rather than a screenshot, and verify the survivor decodes.
What lossy compression does to a QR code
JPEG divides an image into 8 × 8 pixel blocks and discards the high-frequency detail the eye barely notices. A QR code is almost nothing but high-frequency detail — a grid of hard dark-light transitions — so it takes the damage photographs shrug off:
- Ringing — ghost oscillations that shadow every hard edge, exactly where the decoder thresholds.
- Blocking — visible seams on the 8-pixel grid, cutting across modules.
- Chroma subsampling — common JPEG settings store colour at half resolution in both axes, so coloured codes lose edge definition even at high quality settings.
A lightly compressed code usually still decodes. The problem is that compression is rarely applied once.
The recompression chains
Messaging and social pipelines resize and recompress every image sent the ordinary way. Each hop is a fresh generation of loss on top of the last:
Generator PNG → WhatsApp photo → screenshot → Instagram story → screenshot → print
A code that survives one hop with mushy corners dies quietly on the third. This is why the same code "worked when I sent it" and fails from the file that came back — the two files are not the same image any more. The screenshot-of-a-screenshot chain is the purest version of the fault: every screenshot resamples, every re-share recompresses.
WebP and AVIF at low quality settings damage edges in their own ways — that variant has its own page: WebP and AVIF issues.
The rules
- PNG or SVG, never JPEG. PNG is lossless; SVG is vector and has no pixels to damage. The trade-offs are tabulated at file formats compared.
- Send the file, not a photo. In chat apps, attach the code as a document — the photo path recompresses, the document path preserves the original bytes.
- Never re-share a received copy. Go back to the original file, or regenerate — a QR code is computed from its payload, so a pristine replacement costs seconds.
- On the web, serve the PNG at its exact display size or inline the SVG; letting the browser or a CDN "optimise" a QR code into lossy formats reintroduces the problem.
Rescuing a damaged code
If a compressed copy still decodes, do not ship it — decode it with our scanner to recover the exact payload, then regenerate a clean master. If it no longer decodes and no original exists, the data is gone; no sharpening or upscaling recovers modules that ringing has flipped. Before print, run whatever file actually arrived at the end of the pipeline through the validator — it decodes the rendered result, which is the only verdict that counts.
FAQ
Why does my QR code not scan after sending it on WhatsApp?
Images sent as photos are resized and recompressed, which blurs module edges with JPEG artefacts. Send the code as a document attachment instead, which preserves the original file exactly.
Is JPEG ever acceptable for QR codes?
Avoid it. Even at maximum quality, JPEG adds ringing at hard edges and often halves colour resolution. PNG is lossless, universally supported and usually smaller for flat-colour graphics like QR codes — there is no upside to JPEG here.
Can I fix a QR code damaged by compression?
If it still decodes, recover the payload with a scanner and regenerate a clean code — never re-ship the damaged image. If it no longer decodes and you lack the original, the data cannot be reconstructed from the artefacts.
Why did the QR code work on screen but fail after being posted online?
The platform recompressed and resized the upload, and the surviving copy crossed the damage threshold. Test the code as served by the platform, not the file you uploaded — they are different images.
Try it — free, no signup
Related
- QR code not scanning: the checklist — Work through these in order, because they are ranked by how often they are the actual cause: quiet zone, contrast, size for distance, glare, blur from…
- QR codes in WebP and AVIF — what breaks — Lossless WebP and AVIF are safe; lossy defaults are not. The converter-quality trap, pipelines that silently recompress your PNG, and a verdict table.
- QR code changed after I edited the image — Editing pixels never edits the payload, but it can destroy the code — rotation, resizing and recolouring all corrupt modules. Edit the source state instead.
- QR code file formats compared — PNG, SVG, JPEG, WebP, PDF and EPS for QR codes — lossless vs lossy, scaling behaviour, print hand-off, and why JPEG is never the right choice.