0% found this document useful (0 votes)
2 views

Image Compression

Uploaded by

lencho3d
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Image Compression

Uploaded by

lencho3d
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Image Compression is the process of reducing the size of an image file while retaining as much

quality as possible. This is achieved by reducing redundant or irrelevant data, making the image
more efficient for storage or transmission.

Types of Image Compression

1. Lossless Compression
o Reduces file size without losing any information.
o The original image can be reconstructed perfectly.
o Techniques include:
▪ Run-Length Encoding (RLE): Compresses sequences of the same value
(e.g., a row of identical pixels).
▪ Huffman Coding: Encodes frequently occurring pixel values with shorter
binary codes.
▪ PNG Format: Uses lossless compression.
2. Lossy Compression
o Reduces file size by discarding some data, often imperceptible to human eyes.
o Cannot reconstruct the original image perfectly.
o Techniques include:
▪ Transform Coding (e.g., JPEG):
▪ Converts the image into frequency components using techniques
like the Discrete Cosine Transform (DCT).
▪ Discards less noticeable high-frequency components.
▪ Quantization: Groups pixel values into fewer levels.
o JPEG and WebP Formats: Use lossy compression.

Key Metrics in Image Compression

1. Compression Ratio:

Compression Ratio=Original File SizeCompressed File Size\text{Compression Ratio} =


\frac{\text{Original File Size}}{\text{Compressed File
Size}}Compression Ratio=Compressed File SizeOriginal File Size

Higher ratios indicate greater compression.

2. Peak Signal-to-Noise Ratio (PSNR):


o Measures the quality of a compressed image compared to the original.
o Higher values indicate better quality.
3. Mean Squared Error (MSE):
o Quantifies the average squared difference between original and compressed pixel
values.
o Lower values indicate better quality.

Image Compression Techniques

1. Run-Length Encoding (RLE)


o Replaces sequences of repeated pixel values with a single value and a count.
o Best suited for images with large uniform areas (e.g., black-and-white images).
2. Discrete Cosine Transform (DCT)
o Used in JPEG compression.
o Converts spatial image data into frequency components.
o Low-frequency components are retained, and high-frequency ones are discarded.
3. Discrete Wavelet Transform (DWT)
o Used in JPEG2000 compression.
o Provides multi-resolution analysis, better preserving edges.
4. Predictive Coding
o Predicts pixel values based on neighboring pixels and encodes only the difference.
o Effective for lossless compression.
5. Vector Quantization
o Groups similar pixel blocks into clusters and encodes each cluster with a
representative value.
o Commonly used in lossy compression.

Example: JPEG Compression Process

1. Convert the image to YCbCr color space (separates luminance and chrominance).
2. Subsample the chrominance components (reduce resolution for human imperceptibility).
3. Divide the image into 8×88 \times 88×8 blocks.
4. Apply DCT to each block.
5. Quantize the DCT coefficients.
6. Apply Huffman coding to encode the quantized coefficients.

Advantages of Image Compression

• Reduces storage requirements.


• Speeds up image transmission over networks.
• Enables efficient streaming and real-time applications.

Challenges
• Loss of Quality (Lossy Compression): Visible artifacts may appear if the compression
is too aggressive.
• Processing Time: High compression ratios can increase computational complexity.
• Compatibility: Some advanced formats may not be supported across all devices.

Applications

• Web Optimization: Reducing load times for websites.


• Medical Imaging: Efficient storage and sharing of diagnostic images (e.g., CT scans,
MRIs).
• Satellite Imaging: Transmitting large image datasets from space to Earth.
• Video Streaming: Reducing the size of video frames (e.g., MPEG).

You might also like