1 / 10

Image Compression

Image Compression. Purposes To minimize storage space To maximize transfer speed To minimize hardware costs Requirements Speedy operation (compression and unpacking) Significantly reduction in required memory No significant loss of quality

mariaford
Download Presentation

Image Compression

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Image Compression • Purposes • To minimize storage space • To maximize transfer speed • To minimize hardware costs • Requirements • Speedy operation (compression and unpacking) • Significantly reduction in required memory • No significant loss of quality • Format of output suitable for transfer and storage • Types • Statistical compression--based on pixels in whole image • Spatial compression--based on the spatial relationship of pixels of similar type • Quantizing compression--reducing number of gray levels and resolution • Fractal compression--based on fractal generating functions 240-373 Image Processing, Leture #16

  2. Statistical Compression • The Huffman Coding • Based on the assumption that the histogram is not normally flat • If 4 of 16 colors are used 60% of the time, 4 more for a further 30% and the rest for 10%, then we could use the following scheme: frequently used four colors 000 001 010 011 next most frequently used colors 1000 1001 1010 1011 the rest 11000 11001 11010 11011 11100 11101 11110 11111 This means that the length (for an 640x480 image=150K) is reduced to [(0.6*3)+(0.3*4)+(0.1*5)] * 640 * 480 = 131.25K 240-373 Image Processing, Leture #16

  3. The average length has been reduced from 4 bits to 3.5 bits • It can be shown that with M gray levels, each with probability of P0, P1, .. PM-1 , The number of bits required to code them is at least Technique 1: The Huffman Code USE: To reduce the space that an image uses on disk or in transit OPERATION: • Order the gray levels according to their frequency of use, most occurrence first • Combine the two least used gray levels into one group, combine their frequencies and reorder the gray levels • Continue to do this until only two gray levels are left • Now allocate a 0 to one of these gray-level groups and a 1 to the other • Work back through the groupings so that where two groups have been combined to form a new, larger, group which is currently coded as ‘ccc’ • Code one of the smaller groups as ccc0 and the other as ccc1 240-373 Image Processing, Leture #16

  4. Huffman coding example • Example: For a nine-color system, we obtain the following coding: 0 100000 5 01 1 10001 6 000 2 101 7 1001 3 001 8 100001 5 11 Storage has improved from 19000*3 bits = 57000 bits to 51910 bits. 240-373 Image Processing, Leture #16

  5. 240-373 Image Processing, Leture #16

  6. Spatial Compression Technique 2: Run length encoding USE: To reduce the space required by an image OPERATION: • The run is encoded by creating pairs of values: the first representing the gray level and the second how many of them are in the run Example: image giving a sequence: 1 2 1 1 1 1 1 3 4 4 4 4 1 1 3 3 3 5 1 1 1 1 3 3 (24 values) with run length encoding (1,1) (2,1) (1,5) (3,1) (4,4) (1,2) (3,3) (5,1) (1,4) (3,2) this would give: 1 1 2 1 1 5 3 1 4 4 1 2 3 3 5 1 1 4 3 2 (20 values) 240-373 Image Processing, Leture #16

  7. Spatial Compression: Cont’d • Notes • Huffman coding can be performed after Run length encoding • It might be possible to implement the Huffman code only on the run lengths • Contour Coding • Reducing the areas of pixels of the same gray levels to a set of contours that bound those areas • Consider the following image 240-373 Image Processing, Leture #16

  8. 240-373 Image Processing, Leture #16

  9. 240-373 Image Processing, Leture #16

  10. Changing the Domain Technique 3: Compression using the frequency domain USE: To reduce space required for an image OPERATION: • Convert the image to the frequency domain using FFT or FHT • Threshold this new image removing all values less than k • If what is left is significantly less than the original image, using one of the spatial region techniques, store the rest of the image • If it is not significantly less, increase k-- more information will be lost 240-373 Image Processing, Leture #16

More Related