Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Image Compression อ. รัชดาพร คณาวงษ์ วิทยาการคอมพิวเตอร์ คณะ วิทยาศาสตร์ มหาวิทยาลัยศิลปากรวิทยาเขต พระราชวังสนามจันทร์

Similar presentations


Presentation on theme: "1 Image Compression อ. รัชดาพร คณาวงษ์ วิทยาการคอมพิวเตอร์ คณะ วิทยาศาสตร์ มหาวิทยาลัยศิลปากรวิทยาเขต พระราชวังสนามจันทร์"— Presentation transcript:

1 1 Image Compression อ. รัชดาพร คณาวงษ์ วิทยาการคอมพิวเตอร์ คณะ วิทยาศาสตร์ มหาวิทยาลัยศิลปากรวิทยาเขต พระราชวังสนามจันทร์

2 2 Image Compression Reducing the size of image data files While retaining necessary information Original Image Compressed Image file extracted Image file compressdecompress

3 3 Terminology  refer relation between original image and the compressed file 1. Compression Ratio 2. Bits per Pixel A larger number implies a better compression A smaller number implies a better compression

4 4 Compression Ratio Ex 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 (1)

5 5 Bits per Pixel Ex 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 (2)

6 6 Why we want to compress? To transmit an RGB 512X512, 24 bit image via modem 28.2 kbaud(kilobits/second)

7 7 Key of compression DataInformationReducing Data but Retaining Information DATA are used to convey information. Various amounts of data can be used to represent the same amount of information. It’s “Data redundancy” Relative data redundancy

8 8 Entropy Average information in an image. Average number of bits per pixel

9 9 Redundancy Coding Redundancy Interpixel Redundancy Psychovisual Redundancy

10 10 Coding Redundancy Occurred when data used to represent image are not utilized in an optimal manner

11 11 Coding Redundancy(cont) An 8 gray-level image distribution shown in Table rkrk p(r k )code1l 1 (r k )code2l 2 (r k ) r 0 =00.190003112 r 1 =1/70.250013012 r 2 =2/70.210103102 r 3 =3/70.1601130013 r 4 =4/70.08100300014 r 5 =5/70.061013000015 r 6 =6/70.0311030000016 r 7 =10.0211130000006

12 12 Coding Redundancy(cont) Original Image 8 possible gray level = 2 3

13 13 Interpixel Redundancy Adjacent pixel values tend to be highly correlated

14 14 Psychovisual Redundancy Some information is more important to the human visual system than other types of information

15 15 Compression System Model Compression Input Preprocessing Encoding Compressed File Compressed File Output Postprocessing Decoding Compressed File Compressed File Decompression

16 16 Types of Compression There are 2 types of Compression Loseless Compression Lossy Compression

17 17 Loseless Compression No data are lost Can recreated exactly original image Often the achievable compression is mush less

18 18 Huffman Coding  Using Histogram probability  5 Steps Find the histogram probabilities Order the input probabilities(small  large) Addition the 2 smallest Repeat step 2&3, until 2 probability are left Backward along the tree assign 0 and 1

19 19 Huffman Coding(cont)  Step 1 Histogram Probability 40 30 20 10 0 1 2 3 p 0 = 20/100 = 0.2 p 1 = 30/100 = 0.3 p 2 = 10/100 = 0.1 p 3 = 40/100 = 0.4 p 3  0.4 p 1  0.3 p 0  0.2 p 2  0.1  Step 2 Order

20 20 Huffman Coding(cont)  Step 3 Add 2 smallest Natural CodeProbabilityHuffman Code 000.2010 010.300 100.1011 110.41

21 21 Huffman Coding(cont) The original Image :average 2 bits/pixel The Huffman Code:average

22 22 Run-Length Coding Counting the number of adjacent pixels with the same gray-level value Used primarily for binary image Mostly use horizontal RLC

23 23 Run-Length Coding(cont) Binary Image 8X8 horizontal 1st Row8 2nd Row0,4,4 3rd Row1,2,5 4th Row1,5,2 5th Row1,3,2,1,1 6th Row2,1,2,2,1 7th Row0,4,1,1,2 8th Row8

24 24 Run-Length Coding(cont) Extending basic RLC to gray-level image by using bit-plane coding It will better if change the natural code into gray code 1 0 1 00 01 10 11 00 01 11 10 NaturalGray Code

25 25 Lempel-Ziv-Weich Coding(LZW) Assign fixed-length code words to variable GIF,TIFF,PDF CRSPBPEncoded O/P Dictionary Location Dictionary Entry 39 25639-39 391203925739-120 12039120259120-39 39-3912025626039-39-126 … …

26 26 Lossy Compression Allow a loss in the actual image data Can not recreated exactly original image Commonly the achievable compression is mush more JPEG

27 27 Fidelity Criteria Objective fidelity criteria –RMS Error –RMS Signal-To-Noise Ratio Subjective fidelity criteria

28 28 JPEG


Download ppt "1 Image Compression อ. รัชดาพร คณาวงษ์ วิทยาการคอมพิวเตอร์ คณะ วิทยาศาสตร์ มหาวิทยาลัยศิลปากรวิทยาเขต พระราชวังสนามจันทร์"

Similar presentations


Ads by Google