JPEG stands for Joint Photographic Experts Group. We perform such type of compression to reduce the size of the file without damaging its quality. By reducing the size we can store it in a huge amount which was not possible earlier. Reducing the size of images will also improve the efficiency of the system as it will give less load on it.
Process Of JPEG conversation :
Firstly, we convert the R, G, B color format to Y, Cb, Cr format. Some colors are more sensitive to human eyes and thus are high-frequency colors. Some colors of chromium compounds like Cb and Cr are less sensitive to human eyes thus can be ignored. Then we reduce the size of pixels in downsampling. We divide our image into 8*8 pixels and perform forward DCT(Direct Cosine Transformation). Then we perform quantization using quantum tables and we compress our data using various encoding methods like run-length encoding and Huffman encoding.
In the second stage, we decompress our data, It involves decoding where we decode our data, and we again de-quantize our data by referring to the quantization table. Then we perform Inverse DCT and upsampling to convert it into original pixels and finally, color transformation takes place to convert the image into its original color format.
Algorithm of JPEG Data Compression :
- Splitting –
We split our image in the blocks of 8*8 blocks. It form 64 blocks in which each block is referred to as 1 pixel.
- Color Space Transform –
In this phase, we convert R, G, B to Y, Cb, Cr model. Here Y is for brightness, Cb is color blueness and Cr stands for Color redness. We transform it in chromium colors as these are less sensitive to human eyes thus can be removed.
- Apply DCT –
We apply Direct cosine transform on each block. The discrete cosine transform (DCT) represents an image as a sum of sinusoids of varying magnitudes and frequencies.
- Quantization –
In the Quantization process, we quantize our data using the quantization table.
- Serialization –
In serialization, we perform the zig-zag scanning pattern to exploit redundancy.
- Vectoring –
We apply DPCM (differential pulse code modeling) on DC elements. DC elements are used to define the strength of colors.
- Encoding –
In the last stage, we apply encoding either run-length encoding or Huffman encoding. The main aim is to convert the image into text and by applying any encoding we convert it into binary form (0, 1) to compress the data.
- Difference between SVG and JPEG
- Difference between JPEG and GIF
- Difference between JPEG and PNG
- Difference between JPEG and Bitmap
- Create n-child process from same parent process using fork() in C
- Compression of GIF images
- What is Image Compression?
- JBIG2 compression
- Difference between a Data Analyst and a Data Scientist
- Overview of Data Structures | Set 1 (Linear Data Structures)
- The Future of Data Science
- Spatial and Geographical data
- Difference between Information and Data
- Data Structure alignment
- Transmission Impairment in Data Communication
- Expected Properties of a Big Data System
- Characteristics of data in geographical information system (GIS)
- Relationship between Data Mining and Machine Learning
- Univariate, Bivariate and Multivariate data and its analysis
- Signal Processing and Time Series (Data Analysis)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.