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.

Slides:



Advertisements
Similar presentations
1/29/04© University of Wisconsin, CS559 Spring 2004 Last Time Color –Sensor response is computed from the sensor’s response curve and the incoming spectrum.
Advertisements

T.Sharon-A.Frank 1 Multimedia Compression Basics.
Data Compression CS 147 Minh Nguyen.
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.
Chapter 7 End-to-End Data
School of Computing Science Simon Fraser University
Department of Computer Engineering University of California at Santa Cruz Data Compression (3) Hai Tao.
Spatial and Temporal Data Mining
JPEG.
Computer Science 335 Data Compression.
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Multimedia Data The DCT and JPEG Image Compression Dr Mike Spann Electronic, Electrical and Computer.
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
Color spaces and JPEG. Colors physically, color is electro-magnetic radiation (i.e. light with various wave length, between 390nm- 750nm) percieved by.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
1 JPEG Compression CSC361/661 Burg/Wong. 2 Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg.
Image Compression JPEG. Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg and can be embedded.
Spring 2015 Mathematics in Management Science Binary Linear Codes Two Examples.
09/12/02 (C) 2002, University of Wisconsin, CS 559 Last Time Color and Color Spaces –Recall RGB and XYZ Programming assignment 2.
01/31/02 (C) 2002, UNiversity of Wisconsin, CS 559 Last Time Color and Color Spaces.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
9/16/04© University of Wisconsin, CS559 Spring 2004 Last Time Color –The principle of trichromacy says that any spectrum can be matched using three primaries.
Page 18/30/2015 CSE 40373/60373: Multimedia Systems 4.2 Color Models in Images  Colors models and spaces used for stored, displayed, and printed images.
Introduction to JPEG Alireza Shafaei ( ) Fall 2005.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
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.
Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.
2/3/04© University of Wisconsin, CS559 Spring 2004 Last Time Color –Transforming between two color spaces –A gamut is the set of displayable colors in.
: Chapter 12: Image Compression 1 Montri Karnjanadecha ac.th/~montri Image Processing.
Klara Nahrstedt Spring 2011
Concepts of Multimedia Processing and Transmission IT 481, Lecture 5 Dennis McCaughey, Ph.D. 19 February, 2007.
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Indiana University Purdue University Fort Wayne Hongli Luo
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
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.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
Digital Media Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4) Klara Nahrstedt Spring 2014.
09/17/02 (C) 2002, University of Wisconsin, CS 559 Last Time Color Spaces File formats.
Data compression. lossless – looking for unicolor areas or repeating patterns –Run length encoding –Dictionary compressions Lossy – reduction of colors.
The task of compression consists of two components, an encoding algorithm that takes a file and generates a “compressed” representation (hopefully with.
Fig1: component of Demo Set. Fig2:Load Map of M16C Family.
JPEG.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Introduction to JPEG m Akram Ben Ahmed
JPEG. Introduction JPEG (Joint Photographic Experts Group) Basic Concept Data compression is performed in the frequency domain. Low frequency components.
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.
File Compression 3.3.
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
Data Compression.
Algorithms in the Real World
JPEG Image Coding Standard
JPEG.
Data Compression.
Data Compression CS 147 Minh Nguyen.
CMPT 365 Multimedia Systems
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Representing Images 2.6 – Data Representation.
JPEG Pasi Fränti
Last Time Image – basic definition
Presentation transcript:

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 data formatted? –Is it a black and white image, a grayscale image, a color image, an indexed color image? –How many bits per pixel? What other information? –Color tables, compression codebooks, creator information…

CS559-Computer Graphics Copyright Stephen Chenney Indexed Color 24 bits per pixel (8-red, 8-green, 8-blue) are expensive to transmit and store It must be possible to represent all those colors, but not in the same image Solution: Indexed color –Assume k bits per pixel (typically 8) –Define a table containing 2 k colors (24 bits each) –Store the index into the table for each pixel

CS559-Computer Graphics Copyright Stephen Chenney Image Compression Indexed color is one form of image compression –Special case of vector quantization Alternative 1: Store the image in a simple format and then compress with your favorite compressor –Doesn’t exploit image specific information –Doesn’t exploit perceptual shortcuts Two historically common compressed file formats: GIF and JPEG –GIF should now be replaced with PNG

CS559-Computer Graphics Copyright Stephen Chenney GIF Header – Color Table – Image Data – Extensions Header gives basic information such as size of image and size of color table Color table gives the colors found in the image –Biggest it can be is 256 colors, smallest is 2 Image data is LZW compressed color indices

CS559-Computer Graphics Copyright Stephen Chenney LZW Compression Compresses a stream of “characters”, in GIF case they are 1byte color indices Stores the strings encountered in a codebook –When compressing, strings are put in the codebook the second time they are encountered –Subsequent encounters replace the string with the code –Decoding reconstructs codebook on the fly –Advantage: The code does not need to be transmitted

CS559-Computer Graphics Copyright Stephen Chenney JPEG Multi-stage process intended to get very high compression with controllable quality degradation All the images associated with the JPEG slides can be found on

CS559-Computer Graphics Copyright Stephen Chenney Discrete Cosine Transform A transformation to convert from the spatial to frequency domain – done on 8x8 blocks Why? Humans have varying sensitivity to different frequencies Basis functions:

CS559-Computer Graphics Copyright Stephen Chenney Quantization Reduce the number of bits used to store each coefficient by dividing by a given value –Different coefficients are divided by different amounts –Perceptual issues come in here Achieves the greatest compression, but also quality loss “Quality” knob controls how much quantization is done

CS559-Computer Graphics Copyright Stephen Chenney Entropy Coding Standard lossless compression on quantized coefficients –Delta encode the DC components –Run length encode the AC components Lots of zeros, so store number of zeros then next value –Huffman code the encodings

CS559-Computer Graphics Copyright Stephen Chenney Lossless JPEG With Prediction Predict what the value of the pixel will be based on neighbors Record error from prediction –Mostly error will be near zero Huffman encode the error stream Variation works really well for fax messages

CS559-Computer Graphics Copyright Stephen Chenney Color Quantization The problem of reducing the number of colors in an image with minimal impact on appearance –Extreme case: 24 bit color to black and white –Less extreme: 24 bit color to 256 colors Sub problems: –Decide which colors to use (if there is a choice) –Decide which of those each original color maps to

CS559-Computer Graphics Copyright Stephen Chenney Example The example images shown in class came from: Gomes and Velho “Image Processing for Computer Graphics”, Springer, 1997

CS559-Computer Graphics Copyright Stephen Chenney Quantization Error A way of measuring the quality of our approximation Define an error for each color, c, in the original image: d(c, c’), where c’ is the color c maps to under the quantization –Common is to use squared distance in RGB space –Should really use distance in CIE u’,v’ space Sum up the error over all the pixels

CS559-Computer Graphics Copyright Stephen Chenney Uniform Quantization Break the color space into uniform cells Find the cell that each color is in, and map it to the center Generally does poorly because it fails to capture the distribution of colors –Some cells may be empty, and are wasted

CS559-Computer Graphics Copyright Stephen Chenney Uniform Quantization 8 bits per pixel4 bits per pixel

CS559-Computer Graphics Copyright Stephen Chenney Populosity Algorithm Build a color histogram: count the number of times each color appears Choose the n most commonly occurring colors –Typically group colors into small cells first Map other colors to the closest chosen color Problem: May completely ignore under- represented but important colors

CS559-Computer Graphics Copyright Stephen Chenney Populosity Algorithm 8 bits per pixel4 bits per pixel

CS559-Computer Graphics Copyright Stephen Chenney Median Cut Look at distribution of colors Recursively: –Find the “longest” dimension –Choose the median as a color –Split along the median line, and recurse on both halves Works very well in practice

CS559-Computer Graphics Copyright Stephen Chenney Median Cut 8 bits per pixel4 bits per pixel

CS559-Computer Graphics Copyright Stephen Chenney Optimization Algorithms The quantization problem can be phrased as optimization –Find the set of colors and mapping that result in the lowest quantization error Several methods to solve the problem, but of limited use unless the number of colors to be chosen is small