DCT Coefficient Viewer

Visualizes the Discrete Cosine Transform coefficients of JPEG 8×8 blocks. Double compression — saving a JPEG, editing it, and re-saving — creates periodic artifacts in the coefficient histogram that reveal the edit.

500+ images analyzed

Drag & drop a file here, or

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

8×8 Block DCT

Computes the Discrete Cosine Transform on every 8×8 pixel block — the same transform JPEG uses for compression.

Double Compression Detection

Analyzes coefficient histogram periodicity to detect re-compression artifacts that indicate JPEG re-saving after editing.

100% Private

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

How DCT coefficient analysis works

JPEG compression divides an image into 8×8 pixel blocks and applies the Discrete Cosine Transform to each one. This converts spatial pixel data into frequency coefficients — the DC component captures average brightness, while AC coefficients capture edges and texture. The DCT Viewer recomputes this transform and visualizes the coefficient distribution. When a JPEG is edited and re-saved, the second compression pass creates periodic artifacts in the coefficient histogram — a telltale sign of manipulation. For compression-level error analysis, combine with the ELA Scanner.

Why double compression matters

An unedited photo from a camera is compressed exactly once. When someone opens a JPEG, modifies it, and saves it again, the second compression quantizes already-quantized coefficients. This creates a characteristic comb-like pattern in the histogram — peaks at multiples of the new quantization step. The periodicity score quantifies this pattern. A score above 2.5 strongly indicates re-compression. For JPEG quality-level splice detection across image regions, use the JPEG Ghost Scanner.

Visualization modes explained

AC Energy shows the sum of absolute AC coefficients per block as a heatmap. Blocks with different compression history stand out in energy. DC Component visualizes the average brightness of each 8×8 block — useful for seeing the overall luminance structure. Blockiness highlights discontinuities at 8×8 block boundaries — stronger blockiness in some regions may indicate a pasted element compressed at a different quality. For lighting direction analysis, try the Luminance Gradient Scanner.

Who uses DCT analysis

Forensic analysts use DCT analysis to prove an image was re-saved after editing — a key piece of evidence in manipulation cases. Journalists verify that press photos haven't been re-compressed, which would indicate post-capture editing. Insurance investigators detect doctored claim photos. Researchers studying JPEG compression artifacts use it to understand quantization behavior. For metadata-level verification, combine with the Authenticity Checker. For a complete forensic workflow, visit the photo forensics hub.

DCT coefficient analysis is the most direct way to detect JPEG re-compression. While ELA shows error-level differences and the JPEG Ghost Scanner reveals quality-level splices, the DCT Viewer examines the mathematical fingerprint of the compression itself. For noise-level manipulation, use the Noise Analysis Scanner. For AI-generated image detection, try the AI Detector. All processing runs entirely in your browser — your images are never uploaded. Learn more in our articles on JPEG compression artifacts and JPEG ghost analysis.

Frequently Asked Questions

What are DCT coefficients?

DCT (Discrete Cosine Transform) coefficients are the frequency-domain representation of an 8x8 pixel block. JPEG compression converts each block from pixel values to 64 coefficients: one DC coefficient representing average brightness and 63 AC coefficients representing increasingly fine detail. These coefficients are then quantized to reduce file size.

How does the viewer detect double compression?

When a JPEG is saved, edited, and saved again, the second quantization pass creates periodic peaks in the coefficient histogram at multiples of the quantization step sizes. The viewer measures this periodicity — a score above 2.5 strongly suggests double compression, while below 1.8 is consistent with single compression.

What do the three visualization modes show?

AC Energy shows the total high-frequency content per block as a heatmap — blocks from different compression histories show different energy levels. DC Component shows the average brightness of each block. Blockiness highlights discontinuities at 8x8 block boundaries, which are stronger in heavily compressed or re-compressed regions.

Does this only work on JPEG images?

The DCT analysis works on any image format, but double-compression detection is most meaningful for JPEG images since they use DCT-based compression. PNG, WebP, and other formats will still produce valid DCT visualizations showing frequency content, but the periodicity score will not indicate double compression since those formats use different compression methods.

What does the zero coefficient ratio mean?

The zero coefficient ratio is the proportion of AC coefficients that are zero (or near-zero) after the DCT. Higher ratios indicate more aggressive compression — the quantization step was large enough to zero out many coefficients. Typical values range from 0.3 for high-quality JPEGs to 0.8 or higher for heavily compressed images.

Is my image uploaded to a server?

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