Image Compression Experiment on Raw Grayscale Image Lena_gray.bmp Using 8×8 DCT Transform

Resource Overview

This experiment performs image compression on the raw grayscale image Lena_gray.bmp by applying 8×8 DCT transformation. We compare results after keeping only the DC coefficient, and retaining the first 4, 8, and 16 transform coefficients (DC+AC) followed by IDCT reconstruction. Implementation can be achieved using MATLAB's Image Processing Toolbox functions with appropriate block processing and coefficient thresholding techniques.

Detailed Documentation

In this experiment, we conduct image compression on the raw grayscale image Lena_gray.bmp. Initially, we perform an 8×8 block-based Discrete Cosine Transform (DCT) on the entire image. The implementation involves dividing the image into 8×8 pixel blocks and applying 2D-DCT to each block using functions like dct2() from MATLAB's Image Processing Toolbox. We then selectively retain coefficients under three different compression scenarios: keeping only the DC coefficient; preserving the first 4 coefficients (DC + 3 AC coefficients); retaining the first 8 coefficients (DC + 7 AC coefficients); and maintaining the first 16 coefficients (DC + 15 AC coefficients). This coefficient selection is implemented through zigzag scanning and thresholding operations to zero out higher-frequency components. Subsequently, we perform Inverse DCT (IDCT) transformation using idct2() function to reconstruct the image from the modified coefficients. The reconstructed images are compared both visually and quantitatively using metrics like PSNR (Peak Signal-to-Noise Ratio) to evaluate compression artifacts and quality degradation. This experiment provides deep insights into the image compression process and demonstrates how different coefficient retention parameters affect reconstructed image quality. Additionally, it serves as a practical tutorial for using MATLAB's Image Processing Toolbox for digital image processing operations, particularly emphasizing block-based transform coding techniques fundamental to JPEG compression standards. The revised text provides detailed descriptions of experimental procedures and objectives. For additional questions or further guidance on implementation details such as block processing loops or quantization matrix design, please feel free to ask.