Original (Grayscale)
Reconstructed (Q=50)
📷

No Image Loaded

Upload an image or select a sample to begin exploring DCT compression

DCT Basis Functions

Each 8×8 block can be represented as a weighted sum of these 64 basis patterns. The top-left (DC) represents the average value; moving right or down increases horizontal or vertical frequency. Click any basis to learn more.

DC (Average)
Low Frequency
Mid Frequency
High Frequency

How JPEG Compression Works

JPEG uses the Discrete Cosine Transform (DCT) to convert image data from the spatial domain to the frequency domain. This allows it to separate important visual information (low frequencies) from less perceptible details (high frequencies), enabling efficient lossy compression.

🖼️
8×8 Block
📊
DCT
✂️
Quantize
📈
IDCT
🖼️
Output

Key Concepts

Frequency Domain

DCT converts spatial pixel data into frequency components, separating smooth areas from edges and textures.

Perceptual Coding

Human vision is less sensitive to high-frequency details, allowing aggressive compression of those components.

Lossy Compression

Quantization permanently discards information. Lower quality = more zeros = smaller file = more artifacts.

Block Artifacts

At very low quality, 8×8 block boundaries become visible as the algorithm discards too much information.