Sunteți pe pagina 1din 21

Image compression

Vemulapalli muralikrishna
16481D3808
Mtech decs.
Contents
Introduction
Block diagram for image compression
Compression Steps
JPEG
Huffman coding
Image decompression
Conclusion
Introduction
Image compression is a method that reduces the
amount of memory it takes to store in image.
Effectiveness of compression will depend on actual
image data.
We will exploit the fact that the DCT matrix is based on
our visual system for the purpose of image
compression.
This means we can delete the least significant values
without our eyes noticing the difference.
Block diagram for image
compression
8x8 blocks
original
image
Entropy Compressed
DCT Quantizer
Encoder Image Data

Compressed Reconstructed
image Image Data
Entropy
Inverse Quantizer IDCT
Decoder
Compression Steps

Picture Picture Entropy


Quantization
Original Preparation Processing Encoding Image
Image Compressed
1. Preparation: analog to digital conversion.
2. Processing: transform data into a domain
easier to compress.
3. Quantization: reduce precision at which
the output is stored.
4. Entropy encoding: remove redundant
information in the resulting data stream.
JPEG

Joint Photographic Experts Group


Goals: Subjects:
Support still images Quality
True color/grayscale Steps
Continuous-tone
Modes
pictures
Usually lossy
JPEG Picture Quality
0.25 0.5 bits/pixel
Moderate to good quality.
0.5 0.75 bits/pixel
Good to very good quality.
0.75 1.5 bits/pixel
Excellent quality.
1.5 2.0 bits/pixel
Usually indistinguishable
from the original.
Stage 1: Image Preparation

Components Top
Samples

* * * * Line
* * * *
Right

Cn
Left
* * Y j

C2 * X i

C1
1<= n <=255, usually 3 Bottom
Stage 2: Image Processing

Using DCT (Discrete Cosine Transform)


Convert from Spatial to Frequency Domain
Input : 8x8 matrix of 64 values
Output:
1 DC value (basic color of block = average color)
63 AC values
low frequency coefficients, have high values
high frequency coefficients represent sharp edges, have low values
Discrete Cosine Transform (DCT)

A Fourier-related transform similar to the Discrete Fourier


Transform (DFT), but using only real numbers.
Often used in signal and image processing.
Maps values from spatial domain to frequency domain
image areas with low frequency
(large blocks of single color) are compressed more
efficiently.
Used in JPEG, MJPEG, MPEG, and DV Compression.
Stage 3: Quantization

Based on quantization table:


Quantization table: values from 1 to 255
DCT coefficient/Table value
If value > 0, keep DCT coefficient
else, dont keep DCT coefficient
JPEG Quantization

Applying DCT does not reduce data size


Array of coefficients is same size as array of pixels.
Allows information about high frequency components to
be identified and discarded.
Use fewer bits (distinguish fewer different values) for
higher frequency components.
Number of levels for each frequency coefficient may be
specified separately in a quantization matrix.
Computation of the quantized DCT coefficients

T.Sharon-A.Frank
Order in which the quantized values are
transmitted
Huffman coding
After quantization use Huffman coding for compress the
size.
Image Compression

Original Compressed
Image Decompression

Expand runs of zeros and decompress Huffman-


encoded coefficients to reconstruct array of frequency
coefficients.
Use Inverse Discrete Cosine Transform to take data
back from frequency to spatial domain.
Data discarded in quantization step of compression
procedure cannot be recovered.
Reconstructed image is an approximation (usually
very good) to the original image.
Image Decompression
Compressed image Reconstructed image
conclusion
Any questions
Thank You

S-ar putea să vă placă și