- DIP - Computer Vision and Graphics
- DIP - Optical Character Recognition
- DIP - JPEG compression
- DIP - Introduction to Color Spaces
- DIP - High Pass vs Low Pass Filters
- DIP - Convolution theorm
- DIP - Fourier series and Transform
- DIP - Frequency Domain Analysis
- DIP - Laplacian Operator
- DIP - Krisch Compass Mask
- DIP - Robinson Compass Mask
- DIP - Sobel operator
- DIP - Prewitt Operator
- DIP - Concept of Edge Detection
- DIP - Concept of Blurring
- DIP - Concept of Masks
- DIP - Concept of convolution
- DIP - Gray Level Transformations
- DIP - Histogram Equalization
- DIP - Introduction to Probability
- DIP - Histogram Stretching
- DIP - Histogram Sliding
- DIP - Image Transformations
- DIP - Brightness and Contrast
- DIP - Histograms Introduction
- DIP - Concept of Dithering
- DIP - ISO Preference curves
- DIP - Concept of Quantization
- DIP - Gray Level Resolution
- DIP - Pixels Dots and Lines per inch
- DIP - Spatial Resolution
- DIP - Zooming methods
- DIP - Concept of Zooming
- DIP - Pixel Resolution
- DIP - Concept of Sampling
- DIP - Grayscale to RGB Conversion
- DIP - Color Codes Conversion
- DIP - Types of Images
- DIP - Concept of Bits Per Pixel
- DIP - Perspective Transformation
- DIP - Concept of Pixel
- DIP - Camera Mechanism
- DIP - Image Formation on Camera
- DIP - Concept of Dimensions
- DIP - Applications and Usage
- DIP - History of Photography
- DIP - Signal and System Introduction
- DIP - Image Processing Introduction
- DIP - Home
DIP Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Introduction to JPEG Compression
In our last tutorial of image compression, we discuss some of the techniques used for compression
We are going to discuss JPEG compression which is lossy compression, as some data is loss in the end.
Let’s discuss first what image compression is.
Image compression
Image compression is the method of data compression on digital images.
The main objective in the image compression is:
Store data in an efficient form
Transmit data in an efficient form
Image compression can be lossy or lossless.
JPEG compression
JPEG stands for Joint photographic experts group. It is the first interanational standard in image compression. It is widely used today. It could be lossy as well as lossless . But the technique we are going to discuss here today is lossy compression technique.
How jpeg compression works
First step is to spanide an image into blocks with each having dimensions of 8 x8.
Let’s for the record, say that this 8x8 image contains the following values.
The range of the pixels intensities now are from 0 to 255. We will change the range from -128 to 127.
Subtracting 128 from each pixel value yields pixel value from -128 to 127. After subtracting 128 from each of the pixel value, we got the following results.
Now we will compute using this formula.
The result comes from this is stored in let’s say A(j,k) matrix.
There is a standard matrix that is used for computing JPEG compression, which is given by a matrix called as Luminance matrix.
This matrix is given below
Applying the following formula
We got this result after applying.
Now we will perform the real trick which is done in JPEG compression which is ZIG-ZAG movement. The zig zag sequence for the above matrix is shown below. You have to perform zig zag until you find all zeroes ahead. Hence our image is now compressed.
Summarizing JPEG compression
The first step is to convert an image to Y’CbCr and just pick the Y’ channel and break into 8 x 8 blocks. Then starting from the first block, map the range from -128 to 127. After that you have to find the discrete Fourier transform of the matrix. The result of this should be quantized. The last step is to apply encoding in the zig zag manner and do it till you find all zero.
Save this one dimensional array and you are done.
Note. You have to repeat this procedure for all the block of 8 x 8.
Advertisements