Math
Fourier in two dimensions: inside JPEG
Decompose images into orthonormal 8×8 cosine blocks, remove or quantize coefficients and measure reconstruction error.

Try this
A grayscale image is split into 8×8 cosine blocks. Keep low-frequency zigzag coefficients and optionally quantize them with a JPEG-style luminance table. Click a source block to inspect its coefficients. This demonstrates the transform stage, not file encoding.
Equations used in the module
Equations Cuv = ¼ αuαv ΣxΣy (Ixy−128) cos((2x+1)uπ/16) cos((2y+1)vπ/16) α0=1/√2; αk=1 otherwise Quantized coefficient = Q · round(C/Q) PSNR = 10 log₁₀(255²/MSE)


