Skip to content

JPEG Compression Artifacts and Error Level Analysis

Error Level Analysis detects image tampering by exploiting differences in JPEG compression residuals across regions that were saved at different quality levels or re-compressed a different number of times. This topic explains the quantisation mechanism that underlies ELA, how to read an ELA map correctly, and the misinterpretations that make ELA unreliable in untrained hands.

Last updated:

Share

Error Level Analysis (ELA) is a method for detecting inconsistencies in JPEG image compression history. It works by re-compressing the suspect image at a fixed, known quality level and then computing the absolute pixel-level difference between the re-compressed copy and the original. Because JPEG quantisation drives image data toward a stable low-residual floor with each successive save, regions that have been through fewer compression cycles, or that were originally saved at a higher quality than the surrounding image, retain more residual energy and appear brighter in the resulting error map. A tampered region that was pasted from a source image with a different compression history will often display a distinctly different residual magnitude from the authentic background.

The mechanism depends on the mathematics of JPEG quantisation. The JPEG standard compresses images by dividing each 8x8 pixel block into frequency components using the Discrete Cosine Transform, then dividing each component by a quality-dependent step size and rounding to an integer. This rounding introduces error. On a second save, the already-rounded values are close to the new quantisation levels, so the additional error is small. The residual therefore shrinks with each re-save, converging toward a characteristic floor. ELA exploits this convergence: a uniform image will have uniform residuals, and a region that breaks that uniformity has a different compression history.

ELA was described in its current form by Neal Krawetz in 2007 and is implemented in tools such as FotoForensics. It has been used in journalistic verification, intelligence analysis, and courtroom settings across multiple countries. Its value comes with a significant caveat: bright residuals in an ELA map do not prove tampering. High-frequency content such as sharp edges, fine text, and complex textures always shows high residuals regardless of editing. ELA is most useful as a hypothesis-generating tool that directs further analysis, and its findings are most credible when corroborated by metadata examination, copy-move detection, or noise inconsistency analysis.

By the end of this topic you will be able to:

  • Explain how JPEG quantisation works and why successive saves reduce compression residuals toward a stable floor.
  • Describe the ELA procedure, including the choice of reference quality setting and why that choice affects the resulting error map.
  • Interpret an ELA map correctly, distinguishing high-frequency content artifacts from genuine compression-history inconsistencies.
  • Identify the three most common misreadings of ELA output and explain why each can lead to a false conclusion.
  • Describe the evidentiary limitations of ELA and explain how it should be combined with other forensic methods when presenting findings in legal proceedings.
Key terms
Discrete Cosine Transform (DCT)
The mathematical transform JPEG uses to convert each 8x8 pixel block from the spatial domain into frequency coefficients. Higher-frequency coefficients represent fine detail and edges; lower-frequency coefficients represent broad tonal areas. Quantisation is applied to these coefficients, not to raw pixel values.
Quantisation step size
A quality-dependent divisor applied to each DCT coefficient before rounding. A larger step size (lower quality) discards more information and introduces more rounding error on the first save. The JPEG quality setting controls the step sizes through a quantisation table.
Error Level Analysis (ELA)
A forensic method that re-compresses a JPEG at a known quality and measures the absolute pixel difference between the re-compressed and original versions. The resulting map highlights regions with a different compression history from the surrounding image.
ELA residual
The pixel-level absolute difference at a given location after re-compression. High residual means the pixel value moved substantially on re-compression, indicating the region had more information available to lose. Low residual means the region was already near the quantisation floor.
Compression floor
The stable low-residual state that a JPEG region approaches after many successive saves at the same quality. Once the DCT coefficients are near their quantisation levels, re-saving changes them very little, and ELA shows near-zero residual.
Reference quality
The quality setting used to re-compress the image when computing ELA. The choice of reference quality controls the magnitude of all residuals in the map. Using inconsistent reference qualities when comparing images makes the maps incomparable.

How JPEG quantisation works

JPEG compression proceeds in several stages. First, the image is converted from RGB to a luminance-chrominance colour model. Then each channel is divided into 8x8 pixel blocks. Each block is transformed by the Discrete Cosine Transform into 64 frequency coefficients: the DC coefficient at position (0,0) captures the average brightness of the block, and the 63 AC coefficients at increasing frequencies capture progressively finer detail. The human visual system is more sensitive to luminance changes at low frequencies and less sensitive at high frequencies, so JPEG exploits this by applying larger quantisation divisors to high-frequency coefficients.

Quantisation divides each DCT coefficient by a step size from a quantisation table and rounds the result to an integer. The JPEG quality setting, typically a number from 1 to 100, is a shorthand for scaling the entire quantisation table: quality 95 uses small step sizes, preserving most information; quality 50 uses large step sizes, discarding much of it. The rounding step is where information is lost permanently. When the file is later decoded, each quantised coefficient is multiplied back by the step size, but the original pre-rounding value is not recoverable.

On a second save, the decoded pixel values, already affected by rounding from the first save, go through the same process again. But now the DCT coefficients are already close to multiples of the step size, because they were generated by multiplying quantised integers. Re-quantising them introduces only a small additional error. This is the convergence effect: each save reduces the remaining information in the file, and after enough saves the image reaches a state where re-saving changes almost nothing. The residual falls to near zero.

Compression historyTypical ELA residualInterpretation
First save at high quality (95)HighMuch information still present; large rounding error on re-compression
Two saves at same qualityMediumPartial convergence; some information lost on first save
Many saves at same qualityNear zeroNear quantisation floor; re-compression changes almost nothing
Pasted region from higher-quality sourceHigh relative to surroundingsRegion has different compression history; compression-history inconsistency
Pasted region from lower-quality sourceLow relative to surroundingsRegion is already more compressed than surroundings; also an inconsistency

The ELA procedure

Performing ELA requires four steps. First, obtain the original image file, ideally as a bit-for-bit copy with provenance documentation. Do not accept a screenshot or a re-saved copy as the starting point, because doing so introduces an additional compression cycle and erases the history difference you are trying to detect. Second, re-compress the image at a chosen reference quality, typically between 70 and 95, using the same JPEG codec baseline DCT mode. Third, compute the absolute pixel difference between the re-compressed image and the original, channel by channel. Fourth, scale or amplify the result for visual display, because raw differences may be too small to see without magnification.

The choice of reference quality matters. If you choose a reference quality lower than the original save quality, all residuals will be large, obscuring the relative differences you want to see. If you choose a reference quality close to the original save quality, genuine history inconsistencies are most visible. In practice, many analysts use quality 95 as a default reference for an image they believe was originally saved near that level, and experiment with adjacent values to confirm that a suspect region consistently stands out across the range. The FotoForensics web tool and the open-source jpegsnoop utility can both report the quantisation tables embedded in the original file, which gives an estimate of the original quality setting.

Display amplification is the final step. Differences of a few pixel values become visible only when multiplied by a scaling factor, typically 10 to 20 times. This scaling is purely for visualisation; it does not change the underlying measurement. Analysts should report the reference quality and scaling factor used so that another analyst can reproduce the map exactly.

Reading an ELA map correctly

The first rule of ELA interpretation is that bright areas do not mean tampering. High-frequency content, including sharp edges, text, fine fabric patterns, and foliage, always produces high residuals regardless of whether the image has been edited. This is because the DCT coefficients for those regions are spread across many frequency channels, and quantisation rounding affects more of them. An ELA map of a completely authentic portrait photograph will show bright residuals around hair, eyelashes, and clothing texture. That brightness is normal.

What is meaningful is relative brightness within the same image, holding image content constant. If a smooth sky background shows uniformly low residuals across the entire image, but a small patch of that sky shows residuals as high as the sharp edges, that patch is anomalous. It has a compression history different from the surrounding smooth region. That anomaly warrants further investigation. Conversely, if a region within a complex texture shows residuals substantially lower than the surrounding texture, that is also anomalous: the region may have been sourced from a more-compressed original.

A related trap is comparing two images without controlling for the reference quality. An ELA map produced at quality 95 and an ELA map produced at quality 80 are on entirely different scales. Investigators who look at two such maps side by side and compare absolute brightness levels will reach unreliable conclusions. Within a single analysis, use one reference quality and report it.

Common misreadings and their causes

Three systematic errors recur in published ELA misreadings, and they share a common cause: applying ELA without understanding that it measures compression history, not content authenticity.

The first misreading is false positives from inherent high-frequency content. An analyst unfamiliar with how JPEG encodes fine detail sees bright residuals around text embedded in an image and concludes it was overlaid after the original photograph was taken. In many cases, text rendered into an image at save time produces exactly the same ELA signature as text composited later, because both are high-frequency features that resist quantisation convergence. Without corroborating evidence, such as metadata inconsistency or shadow direction mismatch, bright residuals at a text overlay are not diagnostic.

The second misreading is false negatives from a low-quality original. If the original image was saved at quality 50, all regions are already near the quantisation floor. A spliced region sourced from quality 50 content will show the same near-zero residuals as the authentic background, and ELA will not differentiate them. ELA is most sensitive when the original quality is high and the tampered region comes from a substantially different quality source. It is least sensitive when all source materials have similar compression histories.

The third misreading is comparison failure across resaved copies. Social media platforms, messaging applications, and content management systems routinely recompress images on upload. A forensic analyst who obtains a JPEG from a social media download is typically working with a platform-recompressed copy, not the original. ELA on that copy reveals the platform's compression history, not the author's. Presenting that ELA map as evidence of tampering in the original is methodologically wrong. The chain of custody for the digital file is as important as the chain of custody for a physical exhibit.

ELA in context: combining methods

No single image forensic method is reliable in isolation. ELA detects compression-history inconsistencies. Copy-move and splicing detection finds duplicated or cloned regions within the same image. Noise inconsistency and lighting analysis identifies regions where the sensor noise pattern or illumination geometry is inconsistent with the rest of the frame. Metadata analysis checks whether EXIF timestamps, GPS data, and camera model strings are internally consistent. Each method has blind spots that another method covers.

A finding of compression-history inconsistency from ELA is strengthened when the same region also shows: an implausible noise level relative to adjacent regions; shadow geometry that does not match the light sources visible elsewhere in the frame; a copy-move detection match with another part of the image; or an EXIF modification timestamp more recent than the capture timestamp. When multiple independent methods agree on the same region, the convergent evidence is far more credible than any single method alone.

The inverse is also true. If ELA shows an anomaly but every other method shows no inconsistency, the ELA finding requires a more conservative interpretation. Possible explanations include JPEG resave at a different quality for legitimate purposes, intentional selective editing with quality-matched tools, or simply inherent content characteristics. A forensic report that presents ELA findings without acknowledging the null findings of other methods is incomplete and may be challenged successfully in court.

Check your understanding
Question 1 of 4· 0 answered

Why does a JPEG region show lower ELA residuals after multiple saves at the same quality setting?

Key Takeaways

  • JPEG quantisation rounds DCT coefficients, introducing rounding error on first save; each subsequent save reduces the additional error as coefficients converge toward quantisation levels, creating the stable low-residual floor that ELA exploits.
  • ELA detects compression-history inconsistencies, not content inauthenticity. Bright residuals in high-frequency regions such as edges, text, and fine texture are expected and do not indicate tampering.
  • The choice of reference quality controls the magnitude of all residuals; analysts must report the reference quality and display scaling factor so that results are reproducible and comparable across reports.
  • ELA is invalid when applied to a platform-recompressed copy rather than the original file; the chain of digital custody for the file is as important as the physical chain of custody for a traditional exhibit.
  • ELA findings are most credible when corroborated by independent methods such as noise inconsistency analysis, copy-move detection, or metadata examination; a single ELA map is insufficient to support a finding of tampering in court under the evidentiary standards of the US, UK, India, or the EU.
What is Error Level Analysis and what does it detect?
Error Level Analysis re-compresses a JPEG image at a known quality setting, then computes the absolute pixel-level difference between the re-compressed version and the original. Regions that were originally saved at a higher quality retain more detail and show larger residuals after re-compression, while regions that have been through more compression cycles approach a low-residual floor. A spliced region saved at a different quality level, or one that has been re-saved fewer times than the rest of the image, stands out as a bright area in the ELA map.
Why does JPEG quantisation produce detectable artifacts?
JPEG quantisation divides the DCT coefficients of each 8x8 pixel block by a quality-dependent step size and rounds to the nearest integer. On the first save this rounding introduces an error proportional to the step size. On each subsequent save the same process is applied to already-rounded values, and the additional error decreases because the values are already near quantisation levels. This convergence toward a stable low-residual state is the physical basis of ELA: a region that has been saved more times than its surroundings will show less residual.
What are the most common misreadings of an ELA map?
The three most common misreadings are: treating bright areas in a uniformly low-residual image as evidence of tampering when they are simply natural high-frequency regions such as edges, text, or fine texture; treating dark areas as evidence of tampering when the entire image has simply been saved many times at low quality; and comparing ELA maps from images re-compressed at different reference quality settings, making the residuals incomparable. ELA can only support a finding of inconsistency, not prove tampering, and should always be combined with other analysis methods.
Can ELA detect AI-generated images or deepfakes?
ELA was designed for detecting region-level splicing in photographic JPEG images and is not a reliable detector of AI-generated content. Generative models do not produce the JPEG compression history artifacts that ELA exploits; they produce images that may have consistent compression statistics across all regions. ELA may show no anomaly in a fully AI-generated image or may show artifacts that are misread as evidence of tampering. Dedicated AI-image detectors that analyse frequency statistics, model fingerprints, or diffusion artifacts are more appropriate for that task.
What is the legal status of ELA evidence in court?
ELA is a supporting analysis tool rather than a stand-alone forensic method. Courts in multiple jurisdictions, including those applying US Federal Rules of Evidence Rule 702, the UK's Criminal Procedure Rules, and Indian evidence law under the Bharatiya Sakshya Adhiniyam 2023, require that expert testimony be grounded in reliable methodology. ELA findings presented alone, without corroboration from metadata analysis, copy-move detection, noise analysis, or other methods, are unlikely to meet admissibility thresholds. A qualified expert who explains the method's limitations and combines it with corroborating evidence gives ELA its strongest evidentiary footing.

Test yourself on Multimedia Authentication and Deepfake Forensics with free, timed mocks.

Practice Multimedia Authentication and Deepfake Forensics questions

Found this useful? Pass it along.

Share

Spotted an error in this page? Report a correction or read our editorial standards.

Your journey to becoming a forensic professional starts here.

Practice with mock tests, learn from structured notes, and get your questions answered by a global forensic community, all in one place.