Blocky squares and edge halos, and why forwarding a photo makes them
The results for this split in two. Half are encyclopedic, explaining frequency domains and quantisation tables to someone who asked why their photo looks blocky. The other half are a tool with two sentences of text on top of an upload button.
The reader is in neither position. You have a photo that looks wrong in a specific way, and you want to know what the wrongness is, whether you caused it, and whether it can be taken out. Those are three answerable questions and none of them needs the maths.
What follows is the two patterns named so you can tell them apart by sight, the one habit that produces almost every bad case, and an honest line between what a rebuild can smooth and what it will cheerfully invent in place of detail that is no longer there.
Pattern one: blocking, in the flat areas
Zoom in on part of the photo that should be smooth and featureless. A wall, a sky, a shadow, an out-of-focus background. If the smooth area has broken into faint squares, each one a slightly different shade from its neighbours, with the grid lines visible where they meet, that is blocking.
It is the easiest of the two to recognise because the squares line up. They are not random, they do not follow anything in the photograph, and they form a regular grid across the whole frame. Once you have seen it in a sky you will see it everywhere, which is mildly unfortunate.
Blocking shows up first in flat areas for a reason worth knowing: a flat area is where the eye has nothing else to look at, so a small step between two neighbouring patches has nothing to hide behind. The same size of error inside a detailed, textured area is invisible.
- Look in skies, walls, shadows and blurred backgrounds, not in detailed areas.
- The giveaway is regularity. The squares form a grid and ignore the subject.
- Gentle banding across a gradient, like a sky going from pale to deep, is the same effect seen on a slope.
Pattern two: ringing, along the hard edges
Now find the hardest edge in the frame. Black text on a white background is ideal, and failing that a railing against a sky, a window frame, a telephone wire. Look at the pale side of the edge rather than at the edge itself.
Ringing is a faint echo running parallel to the edge, a light halo on the dark side or a dark halo on the light side, sometimes repeating as a second fainter band further out. On text it looks like grime around the letters, which is the single most recognisable version of it and the reason screenshots of documents age so badly when they are saved this way.
The two patterns have the same cause and appear together, so finding one means the other is present somewhere. They are worth separating anyway, because they tell you different things about how much the file has been through: mild ringing on text with clean flat areas is an early stage, while visible squares in a sky means the photo has been compressed hard or compressed repeatedly.
- Check the pale side of a hard edge, and check any text in the frame.
- A halo that runs parallel to the edge is ringing. A smear that runs in one direction is motion blur, which is a different problem entirely.
- Text with grime around the letters is the clearest case there is.
One cause, and the dial that controls it
Both patterns come from the same place. Saving a photo as a JPEG does not record every value that was in the image. It approximates, discarding the finest distinctions on the grounds that the eye will not miss them, and the two patterns are what the approximation looks like when it has been pushed far enough to notice.
How far it goes is set by one dial, the quality setting. In the reference implementation of the format that value runs on a 0 to 100 scale, and it works by choosing how coarsely the image data is rounded off before it is written: the documentation describes constructing the rounding tables from the quality setting, with larger scaling giving lower quality. A high setting rounds gently and the artifacts stay below the threshold of notice. A low setting rounds hard and you get squares in the sky.
That is the whole model, and it is enough to predict everything else on this page. Each save rounds the data off. The rounding is the loss. Nothing restores the values that were rounded away, because nothing recorded what they were.
Why forwarding a photo is itself the cause
Here is the part that surprises people, and it is usually the explanation for a photo that has gone bad without anyone doing anything to it on purpose.
Opening a JPEG costs nothing. Looking at it costs nothing. Copying the file, moving it between folders, putting it on a drive, emailing the file itself as an attachment that arrives unchanged: all free, because the bytes are identical and no new approximation happens.
Saving it again is not free. A JPEG that is opened, decoded and written out again as a JPEG gets rounded off a second time, on top of the first rounding, and the second pass has no way to know which of the values in front of it were real and which were already artifacts. So it approximates the artifacts too, and faithfully preserves them while adding its own. Do that enough times and the squares stop being faint.
Which means the most common cause of a badly damaged photo is not a bad camera or a bad save. It is a chain of them. A photo taken on a phone, posted somewhere, saved from there by someone else, sent through a messaging app, screenshotted, sent on again. Each of those steps is frequently a fresh save at a setting nobody chose, and the damage accumulates because none of it is reversible.
- Opening, viewing and copying a JPEG does not degrade it.
- Every re-save does, and the losses stack rather than replacing each other.
- A screenshot of a photo is a new photo, with everything the old one had wrong plus a new round of its own.
- Platforms and messaging apps generally re-encode what you upload, at a setting you do not get to pick.
Find the shortest chain before you fix anything
Because the damage accumulates per save, the single most effective thing you can do for a photo you care about is not a tool. It is locating the copy that has been through the fewest saves, and it is worth a few minutes of looking before any processing at all.
Work backwards toward the camera. The version in the original photographer’s own library beats the version they posted. The version they posted beats the one you saved from the post. The one you saved beats the one you forwarded to yourself. If the photo came from a person, asking them to send the original file rather than a copy from a chat thread frequently produces a visibly better starting point for free.
The reason this is worth the trouble is that processing cannot undo an earlier generation, but choosing a better input skips the generations entirely. A clean original run through an enhancer and a ten-generation copy run through the same enhancer are not close.
How to stop producing them
Three habits cover almost everything, and all three follow from the one idea that loss happens on save.
Keep one untouched original and never work on it. Whatever came off the camera or the phone goes somewhere you do not edit, and every edit happens on a copy. This costs disk space and saves photographs.
Do not edit in several sittings as a JPEG. Opening a file, adjusting it, saving it, coming back tomorrow, adjusting it again and saving it again is four generations for two edits. Do the work in one pass, or keep the intermediate stage in a format that does not round anything off, and write the JPEG once at the end.
Save at a high quality setting when you do write one, and resist re-sizing a file that has already been compressed. Shrinking an image that already carries artifacts tends to make them more visible rather than less, because the artifacts get resampled along with the picture.
- One original, never edited. Work on copies.
- One editing pass, one final save, rather than a save per session.
- Keep intermediate versions in a format with no rounding if the edit will take more than one sitting.
- Send the file rather than a screenshot of it, when the other person needs the quality.
What a rebuild can smooth, and what it invents
Now the useful question. Clara enlarges and restores detail, and artifacts are a case where it genuinely helps and also a case where the distinction between recovered and invented matters more than usual.
What it does well is the flat areas. Blocking in a sky, a wall or a shadow is a pattern that does not belong to the photograph and does not resemble anything real, so removing it and leaving a smooth gradient in its place is an improvement with very little room for the result to be wrong. There was nothing in that sky to get wrong.
Edges are a genuine repair too, within limits. Ringing along a railing or a window frame sits beside structure that is still present in the file, so firming the edge and taking the halo off has something real to work from. That is the case most likely to produce a result you keep.
Where it stops is fine texture that the rounding has already flattened. Skin, hair, fabric weave, foliage, the print grain of a scanned photograph. Once an area has been smoothed into a few flat patches, the texture is not hiding under the artifacts, it is gone, and anything that appears there afterwards is a plausible version of that kind of texture rather than this photograph’s. For a landscape that is usually fine. For the face of someone you know it is worth looking closely at before you decide the result is the same photo.
Which cases are worth running
The honest split follows from the section above. A photo with visible blocking in its flat areas and structure still present elsewhere is a good candidate and usually improves a lot. Text with ringing around it cleans up well. A photo that is slightly soft and slightly blocky, the ordinary state of anything that has been through a few platforms, is the standard case and the one the result tends to be best on.
A photo where the subject has been flattened to the point that there is no texture left anywhere in it is a weaker candidate, not because nothing will happen but because what happens is substitution rather than repair. And a photo whose real problem is something else, motion blur or a missed focus, does not become a different problem by also being compressed; the other guides here cover telling those apart.
The order worth following is to find the least-saved copy first, run that, and compare against the original at full size rather than on a phone screen. The comparison at full size is where you find out whether the detail that came back is the photograph or a reasonable guess about it.
More guides
Questions
What are JPEG artifacts?
Two visible patterns that appear when the format approximates a photo too hard. Blocking is faint squares in flat areas like skies and walls, lined up in a regular grid that ignores the subject. Ringing is a faint halo running parallel to a hard edge, most obvious as grime around text. They share one cause and appear together.
How do I remove JPEG artifacts?
In flat areas they come out well, because blocking in a sky does not resemble anything real and smoothing it back has little room to go wrong. Edge halos clean up too, since the structure beside them is still in the file. Fine texture that has already been flattened does not come back; it gets replaced with a plausible substitute.
Does re-saving a JPEG make it worse?
Yes, and this is usually the whole story behind a badly damaged photo. Opening, viewing and copying a file cost nothing, but writing it out again as a JPEG rounds the data off a second time, on top of the first, and the second pass cannot tell real detail from existing artifacts. The losses stack and none of them reverse.
Why does a photo look worse after being sent to me?
Because it was probably re-encoded on the way, possibly more than once. Messaging apps and social platforms generally re-save what passes through them at a setting nobody chose, and a screenshot of a photo is a whole new photo carrying everything the old one had wrong plus a fresh round of its own.
What quality setting should I save a JPEG at?
High, and once. The setting controls how coarsely the image data is rounded off before writing, so a high value keeps the approximation below the threshold where you notice it. The bigger win is reducing how many times you save at all: one editing pass ending in one save beats a careful setting applied four times.
How can I tell artifacts from blur?
By the shape of what you see. Artifacts are regular: squares on a grid in the flat areas, halos parallel to the edges. Blur is not regular. A smear running in one direction is motion, a soft disc with no direction is missed focus, and flat waxy detail with no sharp plane anywhere usually means the image has been enlarged.