Image Compression-JPEG. Lossless and Lossy Compression Lossless Lossy 144:1.

Slides:



Advertisements
Similar presentations
Data Compression CS 147 Minh Nguyen.
Advertisements

M-JPEG M-JPEG April 15, 2015 INF5063: Programming heterogeneous multi-core processors.
SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
JPEG.
SWE 423: Multimedia Systems Chapter 7: Data Compression (4)
Image (and Video) Coding and Processing Lecture: DCT Compression and JPEG Wade Trappe Again: Thanks to Min Wu for allowing me to borrow many of her slides.
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
JPEG Still Image Data Compression Standard
Hao Jiang Computer Science Department Sept. 27, 2007
Case Study ARM Platform-based JPEG Codec HW/SW Co-design
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.
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
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.
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.
JPEG Marco Fuentes García Francisco Gea Martínez.
Image Compression JPEG. Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg and can be embedded.
Image and Video Compression
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
CM613 Multimedia storage and retrieval Lecture: Lossy Compression Slide 1 CM613 Multimedia storage and retrieval Lossy Compression D.Miller.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
1. Introduction JPEG standard is a collaboration among : International Telecommunication Union (ITU) International Organization for Standardization (ISO)
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.
JPEG Motivations: Motivations: 1.Uncompressed video and audio data are huge. In HDTV, the bit rate easily exceeds 1 Gbps. --> big problems for.
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.
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.
Multimedia Data DCT Image Compression
Indiana University Purdue University Fort Wayne Hongli Luo
JPEG CIS 658 Fall 2005.
Hardware/Software Codesign Case Study : JPEG Compression.
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
Chapter 9 Image Compression Standards 9.1 The JPEG Standard 9.2 The JPEG2000 Standard 9.3 The JPEG-LS Standard 9.5 Further Exploration Li & Drew1.
Compression There is need for compression: bandwidth constraints of multimedia applications exceed the capability of communication channels Ex. QCIF bit.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4) Klara Nahrstedt Spring 2014.
The JPEG Standard J. D. Huang Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC.
The task of compression consists of two components, an encoding algorithm that takes a file and generates a “compressed” representation (hopefully with.
JPEG (Joint Photographic Expert Group)
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission ( ) Image Compression Quantization independent samples uniform and optimum correlated.
JPEG.
Page 11/28/2016 CSE 40373/60373: Multimedia Systems Quantization  F(u, v) represents a DCT coefficient, Q(u, v) is a “quantization matrix” entry, and.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Introduction to JPEG m Akram Ben Ahmed
Image Processing Architecture, © Oleh TretiakPage 1Lecture 7 ECEC 453 Image Processing Architecture Lecture 8, February 5, 2004 JPEG: A Standard.
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.
Image Compression Lecture 5. Image Compression  GIF (Graphics Interchange Format)  PNG (Portable Network Graphics)  JPEG (Join Picture Expert Group)
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.
JPEG Compression What is JPEG? Motivation
Data Compression.
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
Discrete Cosine Transform
JPEG.
Image Compression Standards (JPEG)
CMPT 365 Multimedia Systems
JPEG Pasi Fränti
JPEG Still Image Data Compression Standard
The JPEG Standard.
Image Coding and Compression
Presentation transcript:

Image Compression-JPEG

Lossless and Lossy Compression Lossless Lossy 144:1

JPEG ( Joint Photographic Experts Group)  Formed in 1986 by ISO and CCITT (ITU-T)  Became International Standard (IS) in 1991  Compression ratio 10 to 50; 0.5 to 2 bpp. At 1 bpp, one 256×256 image takes only 2 sec at 33.6 kbits/s  Digital Compression and Coding of Continuous-Tone Still Images (grayscale or color)  ISO/IEC IS (ITU-T T.81): Requirements and guidelines  ISO/IEC IS (ITU-T T.83): Compliance testing  ISO/IEC IS (ITU-T T.84): Extensions

Picture Formats  Up to lines and pels/line  8 or 12 bits precision  Color-space independent  Up to 255 color components  Each component can be subsampled  Interleaving  To save bits

JPEG (Encoder and Decoder)

Transform  Allow the most efficient representation  Energy concentration  Removal or heavy quantization of some coefficients  Allow perceptually weighted quantization  Easy for entropy coding  Discrete Cosine Transform (DCT)  Widely used in JPEG, H.26x, MPEG

YCbCr Color Space  Y ′ is the luma component and CB and CR are the blue-difference and red- difference chroma components.  Humans can see considerably more fine detail in the brightness of an image (the Y component) than in the color of an image (the Cb and Cr components).

Color Space  Luminance Eye Sensitivity

DCT

SHIFT  Before computing the DCT of the subimage, its gray values are shifted from a positive range to one centered around zero. For an 8-bit image each pixel has 256 possible values: [0,255]. To center around zero it is necessary to subtract by half the number of possible values, or 128  Subtracting 128 from each pixel value yields pixel values on [ − 128,127]

2D Discrete Cosine Transform  For 8*8 blocks  Inverse DCT

DCT  The DCT transforms 64 pixels to a linear combination of these 64 squares. Horizontally is u and vertically is v.

DCT Example  I=imread('lena.bmp');  x=I(1:8, 1:8);  imshow(x)  J=dct2(x);  imshow(log(abs(J)),[]),colormap(jet(64)), colorbar

DC and AC Coefficients  The DC coefficient is rather large value of the top-left corner. The remaining 63 coefficients are called the AC coefficients.  The DCT temporarily increases the bit-depth of the image, since the DCT coefficients of an 8- bit/component image take up to 11 or more bits

Quantization  The human eye is good at seeing small differences in brightness over a relatively large area, but not so good at distinguishing the exact strength of a high frequency brightness variation.  This allows one to greatly reduce the amount of information in the high frequency components.  This is done by simply dividing each component in the frequency domain by a constant for that component, and then rounding to the nearest integer.  This is the main lossy operation in the whole process. As a result of this, it is typically the case that many of the higher frequency components are rounded to zero, and many of the rest become small positive or negative numbers, which take many fewer bits to store.  The advantage of the DCT is its tendency to aggregate most of the signal in one corner of the result.

Quantization  The quantized DCT coefficients are computed with where G is the unquantized DCT coefficients; Q is the quantization matrix above; and B is the quantized DCT coefficients. The JPEG Still Picture Compression Standard, Summary by Gregory K. Wallace (ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz)

Quantization (cont.)  8×8 quantization table Q[u,v]  High-freq coefficients can be quantized more  Color components can be quantized more  q-factor (in some implementation)  A scale factor applied to a fixed Q  For example, using − 415 (the DC coefficient) and rounding to the nearest integer

Entropy Coding  It involves arranging the image components in a "zigzag" order employing run-length encoding (RLE) algorithm that groups similar frequencies together, inserting length coding zeros, and then using Huffman coding on what is left.

Entropy Coding  If the i-th block is represented by Bi and positions within each block are represented by (p,q) where p = 0, 1,..., 7 and q = 0, 1,..., 7, then any coefficient in the DCT image can be represented as Bi(p,q).  Thus, in the above scheme, the order of encoding pixels (for the i-th block) is Bi(0,0), Bi(0,1), Bi(1,0), Bi(2,0), Bi(1,1), Bi(0,2), Bi(0,3), Bi(1,2) and so on.  This encoding mode is called baseline sequential encoding.  Encodes similar-positioned coefficients of all blocks in one go, followed by the next positioned coefficients of all blocks, and so on.

Entropy Coding  So, if the image is divided into N 8×8 blocks {B0,B1,B2,..., Bn-1}, then progressive encoding encodes Bi(0,0) for all blocks, i.e., for all i = 0, 1, 2,...,N-1. This is followed by encoding Bi(0,1) coefficient of all blocks, followed by Bi(1,0)-the coefficient of all blocks, then Bi(2,0)- th coefficient of all blocks,  JPEG's other code words represent combinations of (a) the number of significant bits of a coefficient, including sign, and (b) the number of consecutive zero coefficients that precede it.

Lossy Compression  Since the quantization stage always results in a loss of information, JPEG standard is always a lossy compression codec. (Information is lost both in quantizing and rounding of the floating-point numbers.)

JPEG Encoder  Encoder  Decoder

DC Coding  DC Prediction  Diff(n) = DC(n) – DC(n–1) Histograms of the DC coefficients from the 8×8 DCT of Lenna, showing the entropy reduction with differential coding

Entropy  Entropy  Uncertainty of a signal source X  Bits needed to resolve uncertainty  Probability :  Entropy :

Huffman Coding

Decoding  Taking the DCT coefficient matrix (after adding the difference of the DC coefficient back in)  Using the quantization matrix  Taking the inverse DCT (type-III DCT) results in an image with values (still shifted down by 128)  Add 128  Average absolute error of about 5 values per pixels

Tradeoff Between Quality and Size  Full quality (Q = 100) 83, :1  Average quality (Q = 50) 15,138 15:1  Lowest quality (Q = 1) 1, :1

JPEG 2OOO  Image Coding System (JTC , ISO 15444)  Goals  Low bit-rate compression  e.g., below 0.25 bpp for highly detailed gray-level images  Lossless and lossy compression in a single bitstream  Large images  More than 64K by 64K  Single decompression architecture  Transmission in noisy environments  Computer generated imagery Compound documents: bi-level and gray-scale

Applications  Low bandwidth dissemination of imagery  Medical imagery lossless/lossy compression  Pre-press imagery  Client/server applications (World Wide Web)  Electronic photography  Photo and art digital libraries  Security  Facsimile  Laser print rendering  Scanner and digital copier memory buffers

References  JPEG – William B. Pennebaker, Joan L. Mitchell, JPEG: Still Image Data Compression Standard, Van Nostrand Reinhold, New York, NY, 1993

Any Questions?