Objective Metrics to Measure JPEG Degradation
JPEG compression reduces file sizes by discarding high-frequency visual data, which often results in visible artifacts such as blocking, blurring, and ringing. Objective visual quality metrics provide mathematical and algorithmic frameworks to quantify this degradation without relying on human observers. This article examines the primary full-reference, reduced-reference, and no-reference metrics used to evaluate JPEG compression loss, detailing how traditional error calculations, structural formulas, and modern perceptual models detect compression artifacts.
Traditional Error-Based Metrics (Full-Reference)
Full-reference metrics require both the uncompressed original image and the degraded JPEG image for comparison.
- Mean Squared Error (MSE): MSE calculates the average squared difference between the pixel intensities of the original and compressed images. While mathematically straightforward, MSE treats all pixel errors equally, failing to account for how the human visual system perceives spatial structures or masking effects.
- Peak Signal-to-Noise Ratio (PSNR): Expressed on a logarithmic decibel (dB) scale, PSNR relates the maximum possible power of a pixel value to the MSE of the degradation. While standard in engineering benchmarks, PSNR often correlates poorly with perceived visual quality because it does not isolate specific compression artifacts, such as block boundary discontinuities.
Structural and Perceptual Metrics (Full-Reference)
Perceptual metrics simulate the human visual system (HVS) to better reflect human assessments of image fidelity.
- Structural Similarity Index Measure (SSIM): SSIM compares local patterns of pixel intensities normalized for luminance, contrast, and structural correlation. Because JPEG operates on 8x8 pixel blocks, SSIM evaluates local degradation effectively and correlates significantly better with perceived quality than PSNR.
- Multi-Scale SSIM (MS-SSIM): This extension evaluates structural similarity across multiple resolutions, capturing both fine blockiness and broad structural distortion caused by aggressive quantization.
- Visual Information Fidelity (VIF): VIF approaches quality assessment from an information-theoretic standpoint, measuring the amount of information the human brain can extract from the degraded image relative to the original. It is particularly effective at penalizing the loss of high-frequency texture common in low-bitrate JPEGs.
JPEG-Specific Artifact Metrics (No-Reference / Specialized)
Because JPEG degradation exhibits predictable patterns—namely grid-like blocking along the discrete cosine transform (DCT) 8x8 boundaries and ringing around sharp edges—specialized metrics quantify these specific flaws without needing the original image.
- Generalized Block Impairment Metric (GBIM): GBIM measures inter-pixel differences across 8x8 block boundaries relative to the activity within the blocks, directly quantifying the prominence of the compression grid.
- Wang-Bovik Blockiness Metric: A widely adopted no-reference model that measures both the cross-boundary steps generated by DCT quantization and the loss of spatial activity within blocks due to high-frequency coefficient zeroing.
- Ringing and Blur Metrics: These algorithms isolate high-contrast edges to measure edge spread (blur) and localized high-frequency oscillations surrounding the edges (ringing/mosquito noise), which arise from coarse quantization of high-frequency DCT basis functions.
Learning-Based and Statistical No-Reference Metrics
Modern quality assessment utilizes natural scene statistics (NSS) and deep neural features to assess JPEG degradation without an original reference.
- BRISQUE (Blind/Referenceless Image Spatial Quality Evaluator): BRISQUE computes locally normalized luminance coefficients. Because natural images have regular statistical distributions that are disrupted by JPEG artifacts, deviations from these distributions yield an accurate score of compression degradation.
- LPIPS (Learned Perceptual Image Patch Similarity): A deep-learning-based metric that measures the distance between feature activations across layers of a convolutional network. LPIPS captures complex perceptual degradations and aligns closely with human judgments of severe compression artifacts.