Seminar Report on image compression

4,249 views
3,939 views

Published on

SEMINAR REPORT ON IMAGE COMPRESSION

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,249
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
326
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Seminar Report on image compression

  1. 1. SEMINAR REPORT ON IMAGE COMPRESSION Submitted in partial fulfillment for the award of the Degree of Master of Computer Application from Biju Pattnaik University of Technology, Rourkela By:- Group(3rd ) MCA 4th Semester:-- PARDIP KUMAR Under the guidance of K. MOHANTA Department of MCA PURUSHOTTAM INSTITUTE OF ENGINEERING & TECHNOLOGY, ROURKELA 2010 1
  2. 2. ACKNOWLEDGEMENT Contents:-- 1.Overview 2.What is image compression? 3.Why do we need image compression? 4.Terminology used in image compression 5.Entropy 6.Compression system model 7.Algorithms for image is compressed 8.Different coding method used in image compression 9.Some common image formats 10. Conclusion 2
  3. 3. OVERVIEW *Image Compression is the Image data Elaboration dedicated to the image data representation. *It analyzes the techniques allowing to reduce the amount of data to describe the information content of the image. *Data transfer rates are not keeping up due to bandwidth limitation and bottlenecks in existing systems. *Image compression allows faster retrieval from disk and makes use of advances in CPU speed. *Image compression is intranet friendly. *Image compression has important applications in image storage and delivery. * Therefore, with scalable image compression, it is possible to browse large images quickly and on demand. *image compression makes possible the adjustment of image quality and resolution after the photo is shot, so that instead, the original digital photos always can be shot at the highest possible quality and resolution, and when the camera memory is filled to capacity, the compressed bitstream of existing shots may be truncated to smaller size to leave room for the upcoming shots 3
  4. 4. WHAT IS IMAGE COMPRESSION? Image compression is the application of data compression on digital images. In effect, the objective is to reduce redundancy of the image data in order to be able to store or transmit data in an efficient form. A chart showing the relative quality of various jpg settings and also compares saving a file as a jpg normally and using a "save for web" technique Image compression can be lossy or lossless. Lossless compression is sometimes preferred for medical imaging, technical drawings, icons or comics. This is because lossy compression methods, especially when used at low bit rates, introduce compression artifacts. Lossless compression methods may also be preferred for high value content, such as medical imagery or image scans made for archival purposes. Lossy 4
  5. 5. methods are especially suitable for natural images such as photos in applications where minor (sometimes imperceptible) loss of fidelity is acceptable to achieve a substantial reduction in bit rate. The lossy compression that produces imperceptible differences can be called visually lossless. Why do we need compression? Requirements may outstrip the anticipated increase of storage space and bandwidth. The figures in Table 1 show the qualitative transition from simple text to full- motion video data and the disk space, transmission bandwidth, and transmission time needed to store and transmit such uncompressed data. Table 1 Multimedia data types and uncompressed storage space, transmission bandwidth, and transmission time required. The prefix kilo- denotes a factor of 1000 rather than 1024. Multimedia Data Size/Duration Bits/Pixel or Bits/Sample Uncompressed Size (B for bytes) Transmission Bandwidth (b for bits) Transmission Time (using a 28.8K Modem) A page of text 11'' x 8.5'' Varying resolution 4-8 KB 32-64 Kb/page 1.1 - 2.2 sec Telephone quality speech 10 sec 8 bps 80 KB 64 Kb/sec 22.2 sec Grayscale Image 512 x 512 8 bpp 262 KB 2.1 Mb/image 1 min 13 sec Color Image 512 x 512 24 bpp 786 KB 6.29 Mb/image 3 min 39 sec Medical Image 2048 x 1680 12 bpp 5.16 MB 41.3 Mb/image 23 min 54 sec SHD Image 2048 x 2048 24 bpp 12.58 MB 100 Mb/image 58 min 15 sec Full-motion Video 640 x 480, 1 min (30 frames/sec) 24 bpp 1.66 GB 221 Mb/sec 5 days 8 hrs The examples above clearly illustrate the need for sufficient storage space, large transmission bandwidth, and long transmission time for image, audio, and video data. At the present state of technology, the only solution is to compress multimedia data before its storage and transmission, and decompress it at the receiver for play back. For example, with a compression ratio of 32:1, the space, bandwidth, and transmission time requirements can be reduced by a factor of 32, with acceptable quality. 5
  6. 6. Terminology used in image compression It refers relation between original image and the compressed file. (1). Compression Ratio:--A large number implies a better compression. Ex Image 256X256 pixels, 256 level grayscale can be compressed file size 6554 byte. Original Image Size = 256X256(pixels) X 1(byte/pixel) = 65536 bytes (2). Bit Per Pixel:--A smaller number implies a better compression. Bit Per Pixel = (No. of Bits)/(No. of Pixels) Ex Image 256X256 pixels, 256 level grayscale can be compressed file size 6554 byte. Original Image Size = 256X256(pixels) X 1(byte/pixel) = 65536 bytes Compressed file = 6554(bytes)X8(bits/pixel) = 52432 bits 6 RC SizeFileCompressed SizeFileedUncompress RationCompressio == 10 6554 65536 ≈=Rationcompressio 8.0 65536 52432 ≈=PixelperBits
  7. 7. Entropy Entropy encoding which is a way of lossless compression that is done on an image after the quantization stage. It enables to represent an image in a more efficient way with smallest memory for storage or transmission In most images their neighboring pixels are correlated and thus contain redundant information. Our task is to to find less correlated representation of the image, then perform redundancy reduction and irrelevancy reduction. Redundancy reduction removes duplication from the signal source (for instance a digital image). Irrelavancy reduction omits parts of the signal that will not be noticed by the Human Visual System(HVS). Entropy encoding further compresses the quantized values in lossless manner which gives better compression in overall. It uses a model to accurately determine the probabilities for each quantized value and produces an appropriate code based on these probabilities so that the resultant output code stream will be smaller than the input stream. An entropy encoder further compresses the quantized values losslessly to give better overall compression. It uses a model to accurately determine the probabilities for each quantized value and produces an appropriate code based on these probabilities so that the resultant output code stream will be smaller than the input stream. The most commonly used entropy encoders are the Huffman encoder and the arithmetic encoder, although for applications requiring fast execution, simple run-length encoding (RLE) has proven very effective. • Average information in an image. 7 ∑ − = −= 1 0 2 )(log L k kk ppEntropy ∑ − = = 1 0 L k kka plL
  8. 8. 1,,1,0, −== Lkwhere n n p k k  Compression system model consist of two main parts one is compression and another is Decompression. In compression the process is mainly divided in input, preprocessing, encoding and compressed file respectively. First image is inputed then processing is done by using the terminology. In encoding process we use Run length coding and Huffman coding and image is finally compressed. In Decompression system the process is just converse of the compression. Here compressed image is introduced first ,than it is decoded and postprocessing is done. Finally output is obtained. 8
  9. 9. Algorithms for image is compressed The image compression algorithms can be divided into two branches: - Lossless algorithms :- The information content is not modified . - Lossy algorithms:-The information content is reduced and it is not recoverable. Lossless compression algorithm The emergence of multimedia technologies has made digital libraries a reality. Nowadays, libraries, museums, film studios, and governments are converting more and more data and archives into digital form. Some of the data indeed need to be stored without any loss. In this algorithm many coding techniques that will effectively reduce the total number of bits needed to represent the above information. The process involved is generally referred to as compression. The intermediate medium could either be data storage or a communication/ computer network. If the compression and decompression process induce no information loss, the compression scheme is lossless; otherwise it is lossy. A general data compression scheme in lossless algorithm Input output data data If the total number of bits required to represent the data before compression is B0 and the total number of bits required to represent the data after compression is B1, then we define the compression ratio as compression ratio =B0/B1 the compression ratio is much larger than 1.0. the higher the compression ratio, the better the lossless compression scheme, as long as it is computational feasible. 9 Encoder (compression ) Storage or networks Decoder (decompression )
  10. 10. Lossy Algorithm Image compression is in multimedia application, where a higher compression ratio is required , lossy methods are usually adopted. Lossless compression ratio technique is low when the image histogram is relatively flat. For this we have to use lossy compression. In lossy compression , the compress image is usually not the same as the original image but is meant to form a close approximation to the original image perceptually. To quantitatively describe how close the approximation is to original data, some form of distortion measure is required. Lossless vs. Lossy compression: In lossless compression schemes, the reconstructed image, after compression, is numerically identical to the original image. However lossless compression can only a achieve a modest amount of compression. An image reconstructed following lossy compression contains degradation relative to the original. Often this is because the compression scheme completely discards redundant information. However, lossy schemes are capable of achieving much higher compression. Under normal viewing conditions, no visible loss is perceived (visually lossless). Compression Methods used for image compression Lossy/Lossless data compression in Image Processing try to eliminate the spatial redundancies Example of coding techniques are :- Huffman coding:- This method was first introduced by David A. Huffman in a 1952, this was attracted an overwhelming amount of research and has been adopted in many important and/or commercial application, such as fax machines, JPEG, and MEPG. The encoding steps of the Huffman coding described in bottom-up manner. Step 1:--------------------------------------------------------------------- 1. Sort the gray levels by decreasing probability. 2. Add the two smallest probabilities. 3. Sort the new value into the list. 4. Repeat until only two probabilities remain. 10
  11. 11. Step 2:--------------------------------------------------------------------- 1. Give the code 0 to the highest probability, and the code 1 to the lowest probability in the present node. 2. Go backwards through the tree and add 0 to the highest and 1 to the lowest probability in each node until all gray levels have a unique code Example Huffman coding :------------------------------------------- Huffman code of original image 11
  12. 12. Example of Huffman coding Example of Huffman coding 12
  13. 13. The Huffman code • The Huffman code results in unambiguous code. • The code is reversible without loss. • The table for the translation of the code has to be stored together with the coded image. • The Huffman code does not take correlation between adjacent pixels into consideration. Run-length coding Instead of assuming a memoryless source, run-length coding(RLC) exploits memory present in the information source. It is one of the simplest forms of the data compression. The basic 13
  14. 14. idea is that if the information source we wish to compress has the property that symbols tend to form continuous groups, instead of coding each symbol in the group individually, we can code one such symbol and the length of the group. • E.g., 56 56 56 82 82 82 83 80 56 56 56 56 56 80 80 80 creates the run-length code (56, 3)(82, 3)(83, 1)(80, 4)(56, 5). • The code is calculated row by row. • Very efficient coding for binary data. • Important to know position, and the image dimensions must be stored with the coded image Used in most fax machines Example of Run-length coding:------------------------------------------ 14
  15. 15. Run-length coding 15
  16. 16. • Compression Achieved • Original image requires 3 bits per pixel (in total - 8x8x3=192 bits). • Compressed image has 29 runs and needs 3+3=6 bits per run (in total - 174 bits or 2.72 bits per pixel). 16
  17. 17. Some common image formats • JPEG Joint Photographic Experts Group - Exists in many different versions but is always some kind of transformation coding. JPEG is not reversible due to quantification. The JPEG standard supports numerous modes(variations). Some of the commonly used ones are: • Sequential Mode • Progressive Mode • Hierarchical Mode • Lossless Mode Sequential Mode This is the default JPEG mode. Each gray-level image or color image component is encoded in a single left- to-right, top-to-bottom scan. We implicitly assume this mode in the discussion so far. The ”Motion JPEG” video code uses Baseline Sequential JPEG, applied to each image frame in the video. Progressive Mode Progressive JPEG Mode delivers low quality versions of the image quickly, followed by higher quality passes, and has become widely supported in web browser s. such multiple scans of images are of course most useful when the speed of the communication line is low. In Progressive Mode, the first few scans carry only a few bits and deliver a rough picture what is to follow. After each additional scan, more data is received, and image quality is gradually enhanced. Hierarchical Mode Hierarchical JPEG Mode encodes the image in a hierarchy of several different resolutions. The encoded image at the lowest resolution is basically compressed low-pass-filtered image, whereas the images at successively higher resolutions provide additional details. Three level hierarchical JPEG encoder is:- 1. Reduction of image resolution 17
  18. 18. 2. Compress low-resolution image f4 3. Compress difference image d2 & d1 Three level hierarchical JPEG coder 1. Decompress the encoded low-resolution image F4 2. Restore image f2 at the intermediate resolution 3. Restore image f at the original resolution Lossless Mode Lossless JPEG is a very special case of JPEG which indeed has no loss in its image quality. It is rarely used, since its compression ratio is very low compared to other, lossy modes. On the other hand, it meets a special need, and the newly developed JPEG-LS standard is specifically aimed at lossless image compression. 4-step process are used in JPEG Image Compression 1. Transforming RGB to YIQ/YUV, separating intensity from color 2. Identifying redundant data using a Discrete Cosine Transformation(DCT) 3. Quantizing remaining data 4. Encoding the result to minimize storage requirements Example of JPEG compression 18 Start_of__mag
  19. 19. MPEG The Moving Pictures Experts Group (MPEG) was established in 1988 to create standard for delivery of digital video and audio. Membership grew from about 25 experts in 1988 to a community of more than 350, from about 200 companies and organization. It is appropriately recognized that proprietary interests need to be maintained within the family of MPEG standards. MPEG introduces a third frame type- B-frames – and their accompanying bidirectional motion compression. If both directional is successful, two motion vector will be sent, and the two corresponding matching macroblocks are averaged before comparing to the target macroblock for generating the prediction error.. the MPEG encoder and decoder cannot work for any macroblock fro B-frame without its succeeding P or I-frame, the actual coding and transmission order is different from the display order of the video . Conclusion • Image compression is important. • Image compression has come a long way. 19
  20. 20. • Image compression is nearly mature, but there is always room for improvement. 20

×