The document applies the discrete cosine transform (DCT) and its inverse (IDCT) to compress and decompress an image. It first applies DCT row-by-row to the image, discards high-frequency DCT coefficients, applies IDCT to reconstruct each row. It then applies DCT column-by-column to the reconstructed image and discards high frequencies, applies IDCT. It calculates the peak signal-to-noise ratio to quantify compression quality and displays the original and reconstructed images.