CFA Pattern Analysis

Analyze Bayer color filter array demosaicing artifacts. Real camera images retain periodic patterns from the sensor's CFA. Edited, composited, or AI-generated regions lose these patterns.

800+ images analyzed for CFA patterns

Drag & drop a file here, or

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

Bayer Pattern Detection

Camera sensors use a Bayer CFA mosaic (RGGB) to capture color. The demosaicing process leaves characteristic periodic artifacts in the color difference channels — a fingerprint of camera-original imagery.

Editing Detection

Image editing tools like Photoshop, GIMP, or AI generators disrupt or eliminate CFA patterns. Regions that have been cloned, pasted, inpainted, or generated from scratch will show weaker periodicity than untouched areas.

Web Worker Processing

All analysis runs client-side in a background Web Worker. Your image never leaves your device. Adjustable grid resolution lets you balance detail against processing time for large images.

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. This interpolation leaves subtle periodic patterns in the color difference signals (red minus green, blue minus green). These patterns act as a fingerprint of camera-original imagery. For broader metadata analysis, check your photo with the EXIF Checker or examine sensor noise with the Noise Analysis tool.

How CFA analysis detects editing

When an image region is edited — cloned, inpainted, pasted from another source, or generated by AI — the demosaicing periodicity is disrupted or absent entirely. This tool measures 2×2 autocorrelation in the R-G and B-G channels per grid block. Camera-original blocks show characteristic checkerboard correlation; manipulated blocks do not. Unlike ELA which detects recompression, CFA analysis targets the fundamental sensor-level signature of real photographs, making it effective even against high-quality forgeries that survive compression tests.

Limitations and edge cases

CFA analysis has limitations. Flat or low-texture regions (sky, solid walls) lack enough color variation for reliable periodicity measurement — these appear gray on the heatmap. Heavy JPEG compression, aggressive noise reduction, or camera-internal processing can weaken CFA patterns even in genuine photos. Screenshots, scanned documents, and rendered graphics never had a CFA stage, so they will always show zero periodicity. Use CFA analysis alongside other forensic signals: check for clone regions, examine chromatic aberration consistency, or run the Authenticity Checker for a multi-signal verdict.

CFA vs AI-generated images

AI-generated images from diffusion models (Stable Diffusion, Midjourney, DALL-E) and GANs never passed through a physical camera sensor, so they completely lack Bayer demosaicing artifacts. This makes CFA analysis a strong complementary signal for AI detection alongside the AI Detector and FFT Spectrum Analyzer. A genuine camera photo will show periodic CFA patterns; a fully synthetic image will not. Explore all 76 forensic and utility tools at Scanly's full toolkit.

CFA pattern analysis runs entirely in your browser using a Web Worker thread — your images are never uploaded to any server. The analysis heatmap 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 CFA pattern analysis?

CFA (Color Filter Array) pattern analysis examines the subtle periodic artifacts left by a camera sensor's Bayer demosaicing process. Digital cameras capture one color per pixel through an RGGB mosaic filter, then interpolate the missing colors. This interpolation creates a characteristic checkerboard-like pattern in the color difference channels. Regions that retain this pattern are likely camera-original; regions where it is absent may have been edited, composited, or generated synthetically.

How does this detect AI-generated images?

AI-generated images from diffusion models or GANs are rendered mathematically — they never passed through a physical camera sensor with a Bayer CFA. As a result, they completely lack the demosaicing periodicity that real camera photos exhibit. This tool measures that periodicity per block, so fully synthetic images will show uniformly weak CFA scores across the entire grid, distinguishing them from genuine photographs.

What do the heatmap colors mean?

Green blocks show strong CFA demosaicing patterns consistent with camera-original imagery. Yellow blocks have reduced periodicity, possibly indicating editing or heavy processing. Red blocks lack CFA patterns — these regions may have been manipulated, AI-generated, or pasted from a non-camera source. Gray blocks are flat or low-texture areas where the analysis is unreliable due to insufficient color variation.

Why does my unedited photo show weak CFA patterns?

Several legitimate factors can weaken CFA patterns: heavy JPEG compression destroys subtle periodicity, aggressive in-camera noise reduction smooths out demosaicing artifacts, and some modern cameras apply advanced demosaicing algorithms that minimize visible patterns. Flat regions like clear skies naturally lack the texture needed for reliable CFA measurement. A weak score alone does not confirm editing — always cross-reference with other forensic tools.

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 CFA periodicity computation, heatmap generation, and scoring all happen locally via the Canvas API and JavaScript. No image data is transmitted to any server.

How is this different from other forensic tools?

CFA analysis targets sensor-level artifacts unique to camera hardware. ELA detects recompression inconsistencies. Noise analysis examines sensor noise uniformity. Chromatic aberration analysis checks lens optical properties. Clone detection finds copy-paste regions. Each method catches different manipulation types. For the most thorough forensic assessment, combine multiple analyses — CFA is especially strong at distinguishing real photos from fully synthetic or AI-generated images.