Image Compression. Data and information Data is not the same thing as information. Data is the means with which information is expressed. The amount of.

Slides:



Advertisements
Similar presentations
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Advertisements

Data Compression CS 147 Minh Nguyen.
Data Compression Michael J. Watts
Compression & Huffman Codes
Computer Science 335 Data Compression.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
2007Theo Schouten1 Compression "lossless" : f[x,y]  { g[x,y] = Decompress ( Compress ( f[x,y] ) | “lossy” : quality measures e 2 rms = 1/MN  ( g[x,y]
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
©Brooks/Cole, 2003 Chapter 15 Data Compression. ©Brooks/Cole, 2003 Realize the need for data compression. Differentiate between lossless and lossy compression.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Software Research Image Compression Mohamed N. Ahmed, Ph.D.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
Lecture 10 Data Compression.
Chapter 2 Source Coding (part 2)
Compression is the reduction in size of data in order to save space or transmission time. And its used just about everywhere. All the images you get on.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
MULTIMEDIA TECHNOLOGY SMM 3001 DATA COMPRESSION. In this chapter The basic principles for compressing data The basic principles for compressing data Data.
DATA COMPRESSION LOSSY COMPRESSION METHODS What it is… A compression of information that is acceptable in pictures or videos, but not texts or programs.
D ATA C OMMUNICATIONS Compression Techniques. D ATA C OMPRESSION Whether data, fax, video, audio, etc., compression can work wonders Compression can be.
Prof. Amr Goneid Department of Computer Science & Engineering
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Indiana University Purdue University Fort Wayne Hongli Luo
JPEG CIS 658 Fall 2005.
Chapter 7 – End-to-End Data Two main topics Presentation formatting Compression We will go over the main issues in presentation formatting, but not much.
8. 1 MPEG MPEG is Moving Picture Experts Group On 1992 MPEG-1 was the standard, but was replaced only a year after by MPEG-2. Nowadays, MPEG-2 is gradually.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Understanding JPEG MIT-CETI Xi’an ‘99 Lecture 10 Ben Walter, Lan Chen, Wei Hu.
Digital Image Processing Image Compression
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
Image Compression – Fundamentals and Lossless Compression Techniques
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
Image Compression Fasih ur Rehman. Goal of Compression Reduce the amount of data required to represent a given quantity of information Reduce relative.
Chapter 17 Image Compression 17.1 Introduction Redundant and irrelevant information  “Your wife, Helen, will meet you at Logan Airport in Boston.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Chapter 7 Lossless Compression Algorithms 7.1 Introduction 7.2 Basics of Information Theory 7.3 Run-Length Coding 7.4 Variable-Length Coding (VLC) 7.5.
Information Systems Design and Development Media Types Computing Science.
By Dr. Hadi AL Saadi Lossy Compression. Source coding is based on changing of the original image content. Also called semantic-based coding High compression.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM M ULTIMEDIA OF D ATA C OMPRESSION Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny.
Entropy vs. Average Code-length Important application of Shannon’s entropy measure is in finding efficient (~ short average length) code words The measure.
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
Data Compression Michael J. Watts
Image Compression (Chapter 8)
JPEG Compression What is JPEG? Motivation
IMAGE PROCESSING IMAGE COMPRESSION
Compression & Huffman Codes
IMAGE COMPRESSION.
Lecture 10: data compression
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Algorithms in the Real World
JPEG Image Coding Standard
JPEG.
JPG vs GIF vs PNG What is the difference?
Data Compression.
Huffman Coding, Arithmetic Coding, and JBIG2
Chapter 7.2: Layer 5: Compression
Data Compression CS 147 Minh Nguyen.
UNIT IV.
COMS 161 Introduction to Computing
GRAPHICAL DATA EXCHANGE FORMATS .jpg .gif .tif.
Image Coding and Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Chapter 8 – Compression Aims: Outline the objectives of compression.
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Presentation transcript:

Image Compression

Data and information Data is not the same thing as information. Data is the means with which information is expressed. The amount of data can be much larger than the amount of information. Data that provide no relevant information = redundant data or redundancy. Image coding or compression has a goal to reduce the amount of data by reducing the amount of redundancy

Definitions n1 = data. n2 = data − redundancy (i.e., data after compression). Compression ratio = CR = n1/n2 Relative redundancy = RD = 1 − 1/CR

Definitions n1 = data. n2 = data − redundancy (i.e., data after compression). Compression ratio = CR = n1/n2 Relative redundancy = RD = 1 − 1/CR

Different Types of Redundancy CR Coding Redundancy. IR Interpixel Redundancy. PVR Psycho-Visual Redundancy

Image compression and decompression

Image Compression Image compression can be: Reversible (loss less), with no loss of information. –A new image is identical to the original image (after decompression). –Reversibility is necessary in most image analysis applications. –The compression ratio is typically 2 to 10 times. –Examples are Huffman coding and run-length coding. Non reversible (lossy), with loss of some information. –Lossy compression is often used in image communication, video,WWW, etc. –It is usually important that the image visually is still nice. –The compression ratio is typically 10 to 30 times.

Objective measures of image quality

Subjective measures of image quality Let a number of test persons grade the images as bad/acceptable/good etc.

Coding redundancy Use shorter code words fore the more common gray levels and longer code words for the less common gray levels. This is called Variable Length Coding. The amount of data in an M × N image with L gray levels is equal to M × N × L avg, where l(r k ) is the number of bits used to represent gray level r k, and p(r k ) is the probability of gray level r k in the image.

Example 3-bit image

Interpixel Redundancy There is often correlation between adjacent pixels, i.e., the value of the neighbors of an observed pixel can often be predicted from the value of the observed pixel. Coding methods: –Run-Length coding. –Difference coding

Run-length coding Every code word is made up of a pair (g, l) where g is the gray level, and l is the number of pixels with that gray level (length, or “ run ” ). E.g., 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.la University) Image Coding an

Run-length coding

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 bits or 2.72 bits per pixel).

Difference coding f (x i ) = E.g., original Code f(x i ) − The code is calculated rob by row. Both run-length coding, and difference coding are reversible, and can be combined with, e.g., Huffman coding X i if i = 0, x i − x i-1 if i > 0

Example of difference

The Huffman code Yields the smallest possible number of unique code symbols per source symbol. –Step 1. –1 1. Sort the gray levels by decreasing probability. –2 2. Add the two smallest probabilities. 3. Sort the new value into the list. 4. Repeat until only two probabilities remain. –Step 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 Lavg = 3.1 la

Example of Huffman coding

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.

Chain Coding

Eight directions are represented with 3 bits. Upper left corner of the object (7,3) is selected to be the starting point (upper left corner of the image is (0,0)). The edge of the object is followed clockwise until we get back to the starting point.

Chain Coding

We get the following chain code for the object: 7,6,7,7,6,6,5,6,3,3,3,3,4,1,1,1,2. Binary code: starting point directions Bits needed: 2x4+17x3=59 (against 256 for uncompressed image) 7→ 0.23 bits/pixel (against 1 bit/pixel for uncompressed image).

Lossy Compression Transform Coding : Coefficients can be quantized, dropped and coded causing a controlled damage to the image. Possible Transforms: –DFT, DCT, Hadamard etc. MixedTime-Frequency presentations e.g.: Gabor, Waveletsetc

Transform coding Divide the image into n × n sub-images. Transform each sub-image using a reversible transform (e.g., the Hotelling transform, the discrete Fourier transform (DFT) or the discrete cosine transform (DCT)). Quantify, i.e., truncate the transformed image (e.g., by using DFT,and DCT frequencies with small amplitude can be removed without much information loss). The quantification can be either image dependent (IDP) or image independent (IIP). Code the resulting data, normally using some kind of “ variable length coding ”, e.g., Huffman code. The coding is not reversible (unless step 3 is skipped). Divide the image into n × n sub-images. 2

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. MPEG Motion Picture Experts Group - Similar to JPEG, but the motion in comparison to the previous image is calculated,and used in the compression.

Example of JPEG compression

Some more common image formats LZW (Lempel-Ziv-Welch) A “ word-based ” code. The data is represented by pointers to a library of symbols (see Huffman code). LZW compression is loss less, and can often be chosen when TIFF (Tagged Image File Format) images are stored. The result is a smaller file which usually takes a bit longer to decode. An image file directory (set of symbols) is included in the header. GIF (Graphics Interchange Format) Creates a coding for color images where each color is coded by only a few bits (usually three). GIF also uses LZW compression for storage and transfers. GIF is fully reversible (loss less) if less then 256 colors are present in the original image. Remember that the time used for coding, and decoding is important when choosing coding method

Choice of image formats Images used for image analysis should always be stored in a loss less format. Images for the WWW have to be either GIF, JPEG or PNG (due to the license issues GIF). Chose GIF for graphs and hand drawn figures with few color shades (JPEG transform coding and truncation can cause artifacts around sharp edges). Chose JPEG for photos and figures with many colors, and smooth transitions between colors (GIF reduces the number of colors to 256).

JPEG: Encoding and Decoding Reconstructed