Successfully reported this slideshow.

image compression in data compression


Published on

term paper

  • Be the first to comment

  • Be the first to like this

image compression in data compression

  1. 1. Term paper Image compressIon In DaTa compressIon submITTeD by:JabIr alI roll no.a90 cap 604 reg-11102338 submITTeD To:sarucHI mam
  2. 2. Acknowledgement I would like to express my special thanks of gratitude to my teacher who gave me the golden opportunity to do this wonderful project on the topic (“image compression in data compression”) which also helped me in doing a lot of research and I came to know about so many new things I am really thankful to him . Secondly I would also like to thank my parents and friends who helped me a lot in finishing this project within the limited time I am making this project not only for marks but to also increase my knowledge thanks again to all who helped me.
  3. 3. 1. 2. 3. 4. 5. CONTENT Introduction to image comp. Image Compression Coding Reduce the Correlation between Pixels Quantization Entropy Coding • Differential encoding • Huffman encoding • Frame building Introduction to image compression Image compression is an application of data compression that encodes the original image with few bits. The objective of image compression is to reduce the redundancy of the image and to store or transmit data in an efficient form. shows the block diagram of the general image storage system. The main goal of such system is to reduce the storage quantity as much as possible, and the decoded image displayed in the monitor can be similar to the original image as much as can be.
  4. 4. Color specification (1) Luminance: received brightness of the light, which is proportional to the total energy in the visible band. (2)Chrominance: describe the perceived color tone of a light, which depends on the wavelength composition of light chrominance is in turn characterized by two attributes – hue and saturation. 1. hue: Specify the color tone, which depends on the peak wavelength of the light 2. saturation: Describe how pure the color is, which depends on the spread or bandwidth of the light spectrum Image Compression Coding Image compression coding is to store the image into bit-stream as compact as possible and to display the decoded image in the monitor as exact as possible. Now consider an encoder and a decoder as When the encoder receives the original image file, the image file will be converted into a series of binary data, which is called the bit-stream. The decoder then receives the encoded bit-stream and decodes it to form the decoded image. If the total data quantity of the bit-stream is less than the total data quantity of the original image, then this is called image compression.
  5. 5. Reduce the Correlation between Pixels The correlation between one pixel and its neighbor pixels is very high, or we can say that the values of one pixel and its adjacent pixels are very similar. Once the correlation between the pixels is reduced, we can take advantage of the statistical characteristics and the variable length coding theory to reduce the storage quantity. This is the most important part of the image compression algorithm; there are a lot of relevant processing methods being proposed. Predictive Coding: Predictive Coding such as DPCM (Differential Pulse Code Modulation) is a lossless coding method, which means that the decoded image and the original image have the same value for every corresponding element. Orthogonal Transform: Discrete Cosine Transform (DCT) are the two most well-known orthogonal transforms. The DCT-based image compression standard such as JPEG is a lossy coding method that will result in some loss of details and unrecoverable distortion. Subband Coding: Sub band Coding such as Discrete Wavelet Transform(DWT) is also a lossy coding method. The objective of sub band coding is to divide the
  6. 6. spectrum of one image into the low pass and the high pass components. JPEG 2000 is a 2-dimension DWT based image compression standard. Quantization The main objective of entropy coding is to achieve less average length of the image. Entropy coding assigns code words to the corresponding symbols according to the probability of the symbols. In general, the entropy encoders are used to compress the data by replacing symbols represented by equal-length codes with the code words whose length is inverse proportional to corresponding probability. JPEG – Joint Picture Expert Group The Encoder and Decoder model of JPEG. We will introduce the operation and fundamental theory of each block in the following sections. The Encoder model of JPEG compression standard
  7. 7. The Encoder model of JPEG compression standard
  8. 8. The Decoder model of JPEG compression standard
  9. 9. Quantization in JPEG The goal of quantization is to reduce most of the less important high frequency DCT coefficients to zero, the more zeros we generate the better the image will compress. The matrix Q generally has lower numbers in the upper left direction and large numbers in the lower right direction. Though the high-frequency components are removed, the IDCT still can obtain an approximate matrix which is close to the original 8×8 block matrix. The JPEG committee has recommended certain Q matrix that work well and the performance is close to the optimal condition, the Q matrix for luminance and chrominance components is defined.
  10. 10. Zigzag Scan After quantization, the DC coefficient is treated separately from the 63 AC coefficients. The DC coefficient is a measure of the average value of the original 64 image samples. Because there is usually strong correlation between the DC coefficients of adjacent 8×8 blocks, the quantized DC coefficient is encoded as the difference from the DC term of the previous block. This special treatment is worthwhile, as DC coefficients frequently contain a significant fraction of the total image energy. The other 63 entries are the AC components. They are treated separately from the DC coefficients in the entropy coding process. The zigzag scan
  11. 11. Entropy Coding in JPEG Differential Coding The mathematical representation of the differential coding is: Differential Coding Run-Length Coding After quantization and zigzag scanning, we obtain the one-dimensional vectors with a lot of consecutive zeroes. We can make use of this property and apply zero-run -length coding, which is variable length coding. Let us consider the 63 AC coefficients in the original 64 quantized vectors first. 57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ..., 0 We encode then encode the vector (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) EOB The notation (L,F) means that there are L zeros in front of F, and EOB (End of Block) is a special coded value means that the rest elements are all zeros. If the
  12. 12. last element of the vector is not zero, then the EOB marker will not be added. On the other hand, EOC is equivalent to (0,0), so we can express (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; (0,0) Huffman Encoding Significant levels of compression can be obtained by replacing long string of binary digits by a string of much shorter code words The length of each code word being a function of its relative frequency of occurrence The JPEG Huffman coding restricts the number of previous zero(s) within 15 because the length of the encoded data is 4 bits. Hence, we can encode 57, eighteen zeroes, 3, 0, 0, 0, 0, 2, thirty-three zeroes, 895, EOB into (0,57) ; (15,0) ; (2,3) ; (4,2) ; (15,0) ; (15,0) ; (1,895) ; (0,0) (15,0) is a special coded value which indicates that there are 16 consecutive zeroes. Therefore, the both of the values 18 and 33 are converted to 15. The right value of the bracket is called category, and the left value of the bracket is called run. We can encode the category by looking up which is specified in the JPEG standard. For example, 57 is in the category 6 and the bits for the value is 111001, so we encode it as 6,111001. The full encoded sequence of 57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ..., 0 (0,6,111001);(0,6,101101);(4,5,10111);(1,5,00001);(0,4,0111);(2,1,1);(0,0)
  13. 13. The JPEG standard specifies the Huffman table for encoding the AC coefficients The final step is to encode by using the Huffman The encoding method is quite easy and straight forward. For instance, the code (0,6) is encoded as 1111000, and the code (4,5) is encoded as 1111111110001000. The final bit-stream stored in the JPEG file 57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ..., 0 1111000 1111001 , 111000 101101 , 1111111110011000 10111 , 11111110110 00001 , 1011 0111 , 11100 1 , 1010
  14. 14. Frame Building The frame builder is to encapsulate all the information relating to an encoded image/picture in this format