What is error level analysis (ELA), and does it work on AI images?

Error level analysis saves a JPEG again at a known quality and displays the difference from the original. Regions that were compressed differently, such as pasted or edited areas, can stand out. It is a hint for spotting splices, not a test for AI generation, and its output is easy to over-read, because texture, edges and resizing also change the error level.

Last updated: 2026-11-06

Before and after naturalization, full image on both sides with the highest-texture area enlarged at two magnifications
Source: ai-sd15-guides-error-level-analysis.png, 512×512. After: JPEG, Samsung SM-S928B EXIF, Samsung (mesurée) quantization table. SSIM 0.8327, PSNR 21.4 dB. Full image on both sides, then the same detail at 100 % zoom and 200 % zoom.

The idea behind ELA

JPEG is lossy. Each time an image is saved, the encoder divides blocks of the picture into frequency components and rounds them. The first save introduces rounding errors. A second save at the same quality introduces fewer, because the values are already close to what the quantiser would produce. A region that has been through fewer or different saves behaves differently from the rest.

Error level analysis exploits that. You save the image again at a chosen quality, take the pixel-by-pixel difference from the original and amplify it so the differences are visible. In an image saved once, the error should be fairly even for similar content. In a composite where one region came from another file, the region with a different history can show a distinct error level.

How to read an ELA picture

The risk is reading brightness as evidence of editing when it is only evidence of detail. The useful signal is inconsistency: two regions with similar texture but very different error levels.

Why it does not detect AI generation

An image made by a generator and saved once as a JPEG has a single compression history. There is no pasted region and no earlier save to contrast with. ELA has nothing to compare, and the result looks like any single-save photograph.

Resizing makes the picture even less informative. Scaling resamples every pixel and discards the block structure ELA relies on. Social platforms resize and recompress uploads, which is why ELA on a downloaded copy often shows a uniform wash.

Some detectors do use compression cues, but they are trained classifiers using many features, not a simple difference image.

What forensic analysts add

Careful analysts combine ELA with other evidence.

How it interacts with processing

When PassReal processes an image, the output is a freshly encoded JPEG. That gives it one compression history from the pipeline's final save, with quantization tables matched to the declared camera and EXIF from a real camera body. Before that step, the pipeline removes C2PA, IPTC digital source type, XMP and PNG text chunks, adds a sensor model and filters the spectrum.

That is a description of what the file contains, not a promise about forensic tools. ELA is interpretive, and different analysts read the same picture differently. PassReal does not remove SynthID or any pixel-level watermark.

Using ELA responsibly

A worked example

Take a phone photo, save it as a JPEG, and run ELA. You will see bright outlines around edges and darker flat areas. Now paste a small logo from a different file onto it, save once, and run ELA again. The logo region often shows a distinct brightness from the surroundings, because it carries a different compression history. Finally, resize the whole image by a third and repeat. Most of the contrast between the pasted region and its surroundings fades. That sequence shows both the usefulness and the fragility of the method.

Try it on your own file

Run ELA on one of your images, process the same file with PassReal's three free images, and run ELA again. Comparing the two tells you more about the method than any explanation does.

What is checkedValue
Accepted formatsPNG, JPEG, WebP
Maximum size20 MB
Maximum dimension8192 px on the longest side
Sensor grain intensity0.018
Lateral chromatic aberration1.25 px at the corners, none at the centre
Frequency cutoff0.88 of Nyquist

Questions

Can ELA tell me whether an image is AI-generated?

Not reliably. It was designed to flag regions with a different compression history, which suits spliced photos. A fully generated image has one history, so there is nothing to compare.

How do I run ELA?

Save the image as a JPEG at a fixed quality, subtract it from the original, amplify the difference and view it. Many free web tools and forensic suites do these steps for you.

Why do edges and textures look bright in ELA?

High-frequency detail changes more when compressed again, so sharp edges and fine textures show larger differences even in an untouched photograph.

Does PassReal affect ELA?

Yes, because it re-encodes the image as a JPEG, which gives the file a fresh compression history. We make no claim about how any forensic reading will interpret it.

What is a better check for provenance?

Read the metadata and any C2PA manifest first, since they state origin directly. Treat ELA as one clue among several, not a verdict.

Limits

Naturalization operates on the pixels and on the file, not on the content of the image. A subject that is implausible - six fingers, inconsistent reflections, text that does not read - stays implausible after processing, and a human reviewer will notice it. PassReal changes what a statistical classifier measures, not what a person sees.

Results vary by generator, by subject and by detector, and detectors are retrained. No pass rate is published on this page because none has been measured in a way that would still hold next month.

Clean an image in seconds

Three images free, no card. Then $2 an image, or Pro at $19 a month for 100.