Luminance Gradient Scanner

Maps brightness gradients across an image using the Sobel operator. Composited elements from photos with different lighting produce abrupt gradient boundaries that reveal the edit.

500+ images analyzed

Drag & drop a file here, or

JPG PNG WebP GIF BMP AVIF Max 50MB • Processed in browser

Sobel Gradient Operator

Computes horizontal and vertical gradients using a 3×3 Sobel kernel, then combines them into a magnitude map showing brightness transitions.

Direction Analysis

Uses gradient direction to determine the dominant light angle. Composited objects lit from different directions stand out in direction mode.

100% Private

All analysis runs locally in your browser via Web Worker. Nothing is uploaded to any server.

How luminance gradient analysis works

Every photograph records a scene lit by one or more light sources. This creates a brightness surface — smooth gradients from highlight to shadow that follow the geometry of objects and light direction. The Luminance Gradient Scanner converts the image to grayscale, then applies a 3×3 Sobel operator to compute horizontal and vertical brightness derivatives. The resulting magnitude map shows where brightness changes rapidly (edges, shadows) versus gradually (flat surfaces, skies). When someone composites elements from different photos, the pasted region carries its original lighting, creating abrupt gradient boundaries that don't match the surrounding scene. For noise-level detection, combine with the Noise Analysis Scanner.

Understanding the controls

Heatmap mode maps gradient magnitude from blue (flat, low gradient) through green and yellow to red (strong edges). Direction mode encodes the gradient angle as hue and magnitude as brightness — consistent lighting appears as a uniform dominant color, while composited regions show a different hue. Grayscale mode shows raw magnitude in black-and-white. Amplification (0.5–3×) scales the gradient for visibility — increase it on low-contrast images, decrease on high-contrast ones. The overlay toggle blends the gradient map at 50% opacity with the original for easier spatial orientation. Use the Re-run button to adjust parameters without re-uploading. For compression-based analysis, try the ELA Scanner.

Why lighting direction matters

A single light source produces gradients that flow in a consistent direction across all objects in a scene. The scanner computes the dominant gradient direction using an 8-sector histogram weighted by magnitude. When a person is pasted from a studio photo (lit from the left) into an outdoor scene (lit from above), the Direction mode reveals the mismatch as a contrasting hue in that region. The block-based consistency analysis divides the image into 32×32 blocks and computes the coefficient of variation — a high value with many anomalous blocks strongly suggests compositing. For copy-paste forgery analysis, use Clone Detection. For JPEG quality splice detection, try the JPEG Ghost Scanner.

Who uses luminance gradient analysis

Forensic investigators use gradient analysis to detect compositing in evidence images — pasted elements with inconsistent lighting are a hallmark of amateurish manipulation. Journalism fact-checkers verify press photos for signs of inserted or removed subjects. Insurance adjusters examine claim photos where objects appear to have been added to a scene with mismatched shadows. Scientific image reviewers check for undisclosed compositing in figure panels. Photographers use it to evaluate lighting setups and identify unwanted light spill. For metadata-level verification, combine with the Authenticity Checker. For a comprehensive forensic workflow, visit the photo forensics hub.

Luminance gradient analysis is particularly effective at catching composites that other forensic tools miss. ELA and noise analysis focus on compression and texture-level artifacts, while gradient analysis targets the physical property of light itself — its direction, intensity, and falloff. A well-executed composite may survive compression analysis but still betray its origin through inconsistent lighting. For best results, combine the Luminance Gradient Scanner with the Noise Analysis Scanner (texture-level manipulation) and the ELA Scanner (compression-level manipulation). All processing runs entirely in your browser via a Web Worker — your images are never uploaded. For AI-generated image detection, use the AI Detector. Learn more in our articles on detecting edited photos and image forensics guide.

Frequently Asked Questions

What is luminance gradient analysis?

Luminance gradient analysis converts an image to grayscale and applies a Sobel operator to compute brightness derivatives in horizontal and vertical directions. The resulting gradient magnitude map reveals how quickly brightness changes at every pixel. In naturally lit photos, these gradients follow the geometry of objects and the direction of light. Composited elements from photos with different lighting produce abrupt, mismatched gradient boundaries.

What kind of manipulation does the gradient scanner detect?

The scanner is designed to detect compositing where elements from differently lit scenes are combined. It reveals inconsistent shadow direction, mismatched light intensity, artificial brightness boundaries, and pasted objects that carry their original lighting. It is less effective for retouching or color grading, which are better detected by noise analysis or ELA.

What do the three color modes show?

Heatmap mode maps gradient magnitude from blue (low, flat areas) through green and yellow to red (strong edges and shadows). Direction mode encodes the gradient angle as color hue and magnitude as brightness, making lighting direction visible — consistent lighting appears as a dominant hue, while composited regions show a contrasting color. Grayscale mode shows raw gradient magnitude in black and white for simple edge visualization.

What does the consistency verdict mean?

The scanner divides the image into 32x32 pixel blocks and computes the coefficient of variation of gradient magnitude across all blocks. Consistent means the gradient distribution is even (coefficient below 0.35), typical of single-source lighting. Moderate variation (0.35 to 0.65) may indicate complex lighting or minor editing. Inconsistent (above 0.65) with many anomalous blocks suggests compositing from different lighting conditions.

How is this different from ELA or noise analysis?

ELA detects compression-level inconsistencies in JPEG images. Noise analysis detects texture-level manipulation like airbrushing and clone stamping. Luminance gradient analysis detects lighting-level inconsistencies — the physical direction, intensity, and falloff of light. A skilled forger may match compression and noise characteristics but still produce mismatched lighting. These three tools complement each other for comprehensive forensic analysis.

Is my image uploaded to a server?

No. All gradient analysis runs entirely in your browser using a Web Worker. The image never leaves your device. No data is transmitted, stored, or logged.