Demosaicing Trace

A camera sensor records one color per photosite and interpolates the rest. That interpolation leaves a measurable trace. This tool reports one of two things: the trace is there, or it is not measurable on this file — which is the ordinary result for anything that has been resaved or resized.

Drag & drop a file here, or

JPG PNG WebP BMP AVIF Max 50MB • Processed in browser • Nothing leaves your device

Runs in your browser

What Is Measured

Every pixel is predicted from the mean of its four orthogonal neighbours. An interpolated pixel sits close to that mean and a recorded one does not, so residual energy differs across the four phases of the 2×2 mosaic. The reported figure is (max − min) ÷ mean over those four phases.

Absence Proves Nothing

The trace is fragile. On a controlled demosaic it measures 2.019; the same image resaved at JPEG quality 75 falls to 0.388, and a single 0.75× resize takes it to 0.015 — level with an image that never had a mosaic. So a file without the trace has told you nothing about how it was made, and this tool never says otherwise.

Web Worker Processing

All analysis runs client-side in a background Web Worker. Your image never leaves your device. It is also analyzed at full resolution and never downscaled first, because resampling would destroy the very signal being read.

Advertisement

How it works

What is a Bayer color filter array?

A Bayer CFA is a mosaic of tiny color filters (RGGB) placed over a camera sensor. Each pixel captures only one color channel, and the camera's image processor interpolates the missing two — a process called demosaicing. Because an interpolated pixel is built from its neighbours, it sits closer to their average than a recorded pixel does, and that difference falls into a repeating 2×2 pattern. That is the trace this tool looks for. For broader metadata analysis, check your photo with the EXIF Checker or examine sensor noise with the Noise Analysis tool.

What this tool actually measures

Each pixel is predicted from the mean of its four orthogonal neighbours and the leftover residual is squared into one of four buckets, according to its position in the 2×2 mosaic. The reported phase spread is (max − min) ÷ mean across those four buckets, and the threshold for calling the trace present is 0.25. Those numbers come from measurement, not from tuning: an image put through a real RGGB mosaic and a bilinear demosaic scores 2.019, while every sample photograph tested scores at or below 0.043. Unlike ELA, which reacts to recompression, this is a question about one specific step in a camera pipeline — and only that step.

Limitations and edge cases

The trace is fragile, and this is the limitation that matters more than any other. Measured on a controlled demosaic: 2.019 untouched, 1.527 after a JPEG q95 resave, 0.542 at q85, 0.388 at q75, and 0.015 after a single 0.75× resize — the last of these is indistinguishable from an image that never had a mosaic at all. Anything that has passed through a website, a messaging app, an export or an editor has almost certainly lost it. That is why this tool has no verdict and no red band: a result of not measurable on this file is the normal case, and it says nothing about whether the image was edited. Flat regions (sky, solid walls) leave nothing to predict from and show gray. Screenshots and rendered graphics never had a demosaicing stage. Read the result together with other forensic signals: check for clone regions, examine chromatic aberration consistency, or run the Authenticity Checker for a multi-signal verdict.

Can this detect AI-generated images?

Not on its own, and it should not be used that way. It is true that an image from a diffusion model or a GAN never passed through a Bayer sensor and so cannot carry the trace. The problem is the other side of it: a genuine camera photograph that has been resaved or resized cannot carry it either, and every sample photograph tested here scored no higher than a screenshot. So a missing trace does not separate synthetic from real — it separates untouched-from-sensor from everything else. Use it as one input alongside the AI Detector and the FFT Spectrum Analyzer, and treat a found trace as informative while treating its absence as inconclusive. Explore all 131 forensic and utility tools at Scanly's full toolkit.

This analysis runs entirely in your browser using a Web Worker thread — your images are never uploaded to any server, and they are read at full resolution rather than being downscaled first, because a rescale would remove the trace being measured. The result map can be downloaded as a PNG for reports. For a complete forensic workflow, start with the EXIF Checker to examine metadata before running pixel-level analysis. For device-level matching, the Camera Fingerprint (PRNU) tool identifies the specific sensor that captured an image. Learn more in our articles on detecting edited photos and complete forensics guide.

Frequently Asked Questions

What is the demosaicing trace?

A camera sensor sits behind a Bayer mosaic and records only one color per photosite; the other two are interpolated from neighbouring photosites. An interpolated value is built from its neighbours, so it lies closer to their average than a recorded value does, and because the mosaic repeats every two pixels, that difference falls into a fixed 2x2 pattern. This tool predicts every pixel from the mean of its four orthogonal neighbours and compares the leftover residual energy across the four phases of that 2x2 grid. A wide spread means the interpolation step is still visible in the file.

What do the two outcomes mean?

There are only two. Trace found means the phase spread reached 0.25 or above, which is consistent with a file that came off a sensor and has not been resampled since. Not measurable on this file means it did not, and that is where most images land: the trace is removed by any resave or resize. The second outcome is not a finding about the image and is never reported as one. If the image is flat or smaller than 32 by 32 pixels there is nothing to predict from, and the same not-measurable outcome is shown.

Why does my real photo say the trace is not measurable?

Because it almost certainly has been resaved or resized, and neither survives. Measured on a controlled demosaic: 2.019 untouched, 1.527 after a JPEG q95 resave, 0.542 at q85, 0.388 at q75, and 0.015 after a single 0.75x resize, which is the same figure as an image that never had a mosaic. Every sample photograph tested here scored at or below 0.043. Camera JPEG output, a phone gallery export, a messaging app or a website upload can each be enough. This is expected behaviour, not a fault in the photo.

What do the map colors mean?

Amber blocks carry the trace, blue blocks do not, and gray blocks are too flat or too small to measure. Blue is not an accusation: it is the ordinary state of any block in any image that has been through a resave or a resize. There is deliberately no red on this page, because no color here is capable of telling you that a region was edited.

Can this tell me an image is AI-generated?

No. A diffusion or GAN image never passed through a Bayer sensor, so it cannot carry the trace - but neither can a genuine photograph that has been resaved, and in testing the real photographs scored no higher than a screenshot. Absence therefore does not separate synthetic from real. A trace that is found is informative; a trace that is absent is inconclusive, and this tool will not tell you otherwise. Cross-reference with other signals rather than reading a verdict into a missing trace.

Is the image resized before analysis?

No, and that is deliberate. Rescaling resamples every pixel, which rewrites the exact neighbour relationships the prediction reads and destroys the trace, so a capped working canvas would have silently removed the signal on every large upload. The analysis runs at the uploaded resolution, and the size it ran at is shown in the results as Analyzed at.

Are my images uploaded to a server?

No. All analysis runs entirely in your browser using a Web Worker thread. Your images never leave your device. The residual prediction, the phase comparison and the map are all computed locally via the Canvas API and JavaScript. No image data is transmitted to any server.

How is this different from other forensic tools?

It asks one narrow question - is the sensor interpolation step still visible in this file - and it answers found or not measurable. ELA reacts to recompression, noise analysis looks at sensor noise evenness, chromatic aberration checks lens behaviour, and clone detection finds copy-paste regions. None of them, including this one, produces a verdict on its own, and this one is the most easily erased of the group.