Multimedia – Image Compression

Slides:



Advertisements
Similar presentations
Multimedia Data Compression
Advertisements

JPEG Compresses real images Standard set by the Joint Photographic Experts Group in 1991.
Data Compression CS 147 Minh Nguyen.
Time-Frequency Analysis Analyzing sounds as a sequence of frames
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.
SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
School of Computing Science Simon Fraser University
Department of Computer Engineering University of California at Santa Cruz Data Compression (3) Hai Tao.
JPEG.
JPEG Still Image Data Compression Standard
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.
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.
Software Research Image Compression Mohamed N. Ahmed, Ph.D.
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   
JPEG C OMPRESSION A LGORITHM I N CUDA Group Members: Pranit Patel Manisha Tatikonda Jeff Wong Jarek Marczewski Date: April 14, 2009.
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.
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.
Klara Nahrstedt Spring 2011
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.
Indiana University Purdue University Fort Wayne Hongli Luo
JPEG CIS 658 Fall 2005.
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.
Digital Image Processing Image 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.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
Digital Image Processing Lecture 21: Lossy Compression Prof. Charlene Tsai.
Lecture 4: Lossless Compression(1) Hongli Luo Fall 2011.
The task of compression consists of two components, an encoding algorithm that takes a file and generates a “compressed” representation (hopefully with.
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.
Chapter 8 Lossy Compression Algorithms. Fundamentals of Multimedia, Chapter Introduction Lossless compression algorithms do not deliver compression.
Introduction to JPEG m Akram Ben Ahmed
Fundamentals of Multimedia Chapter 6 Basics of Digital Audio Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
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.
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.
Image Processing Architecture, © Oleh TretiakPage 1Lecture 5 ECEC 453 Image Processing Architecture Lecture 5, 1/22/2004 Rate-Distortion Theory,
Chapter 8 Lossy Compression Algorithms
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
Chapter 9 Image Compression Standards
Data Compression.
Digital Image Processing Lecture 21: Lossy Compression
A Simple Image Compression : JPEG
Discrete Cosine Transform
JPEG.
Data Compression.
Data Compression CS 147 Minh Nguyen.
CMPT 365 Multimedia Systems
UNIT IV.
JPEG Still Image Data Compression Standard
Image Coding and Compression
Presentation transcript:

Multimedia – Image Compression Dr. Lina A. Nimri Lebanese University Faculty of Economic Sciences and Business Administration 1st branch

Image Compression To store, treat or print an image, it is necessary to reduce the size of the file of the image while keeping the information applicable It is necessary to compress the image JPEG quality 100% JPEG quality 50 %   JPEG quality 25 % JPEG quality 0 %  

Image Compression Image compression is applying data compression methods on digital images This compression is to reduce the size of an image to be able to store it using little storage space or to transmit it quickly

Image Compression Image compression can be lossless or lossy Lossless compression is sometimes preferred for images: Art drawings, technical designs, icons or comics Requiring a high precision, such as medical scans Lossy methods are appropriate for images: Natural photos, such as photos in an applications or when a minor loss of exactness is acceptable while acheiving a substantial reduction in the binary code.

Lossy Compression Lossless compression algorithms do not deliver compression ratios that are high enough. Hence, most multimedia compression algorithms are lossy. The compressed data is not the same as the original data, but a close approximation of it. Yields a much higher compression ratio than that of lossless compression

Lossy Compression The most important methods of lossy compression are: The reduction of the color depth to the most frequent colors in the image Sub-sampling of chrominance This method takes advantage of the fact that the eye perceives brightness more vigorously than color, dropping at least half of chrominance information in the image Fractal compression

Lossy Compression - continued The most important methods of lossy compression are Compression –Transform Coding This is the most commonly used method Discrete Cosine Transform (DCT) and wavelet transforms are the most popular Transform Coding includes the application of the transformation in the image, followed by quantization and entropy coding

Distortion Measure Distortion is a mathematical measure of error Where xn, yn and N are the input data sequence, reconstructed data sequence, and length of the data sequence respectively. The visual distortion (perceptual distortion) measures the perceived error It is possible to have a very clear visual distortion with a poor measure of distortion An image shifted to the right of a vertical line

The Rate-Distortion Theory Rate: the average number of bits needed to represent a data source Typical Rate Distortion Function: R(D) If D is a tolerable distortion, then R (D) is the minimum rate with which the data source can be coded while having an upper limit of distortion equals to D Provides a framework for the study of tradeoffs between Rate and Distortion.

Fractal Compression Fractal Compression is an image compression little used today It is based on the detection of recurrence of the grounds, and tends to eliminate redundancy of information in the image. Fractal compression is a destructive compression method as all baselines are not reflected in the final image.

Fractal Compression

Compression –Transform Coding Decoding Coding Quanti- zation Transfor- mation Inverse Quatization Inverse Compressed image La transformée en cosinus discrète et la transformation par ondelettes sont les transformations les plus populaires Compressed image

Compression –Transform Coding: JPEG example JPEG is a free code, thus, allowing it to be widely distributed on the Internet It allows you to handle color images in grayscale It has many uses such as medical scanning because it offers a powerful method that is the reason of its widespread distribution

JPEG Segmentation Blocks 8x8 Transformation DCT Quantization Quantization Matrix Coding RLE + Huffman

Discrete Cosine Transform DCT The experts are based on the fact that relevant information of an image, characterized by a two- dimensional signal Img (x, y), are only the components of the low frequency of the signal The eye is less sensitive to high frequencies. The DCT transforms a signal amplitude (each value of the image represents the "magnitude" of the image, and so, its intensity) into a frequency information When working with the matrix Img (x, y), the X and Y axes represent the vertical and horizontal dimensions of the image On the matrix DCT(i, j), the axes represent the frequency of the signal in two dimensions

Discrete Cosine Transform DCT Given An image segmented into blocks 8 × 8 pixels Aim Obtain a new representation of each block: containing the same information Information is concentrated on a few elements Principle Using a matrix of transformation

DCT Formula Inverse DCT Transformation

Discrete Cosine Transform DCT Here is the matrix representing the image and the basic functions F0,0 f00 f01 f02 f03 f04 f05 f06 f07 f10 f11 f12 f13 f14 f15 f16 f17 f20 f21 f22 f23 f24 f25 f26 f27 f30 f31 f32 f33 f34 f35 f36 f37 f40 f41 f42 f43 f44 f45 f46 f47 f50 f51 f52 f53 f54 f55 f56 f57 f60 f61 f62 f63 f64 f65 f66 f67 f70 f71 f72 f73 f74 f75 f76 f77 Matrix representing the image Matrix of the basic functions

Basic DCT functions How the basic matrix is defined? Transformation formula! y=u.π/16 and x=v. π/16 A block of the basic matrix for F0,0 cosy.cosx cos3y.cosx cos5y.cosx cos7y.cosx cos9y.cosx cos11y.cosx cos13y.cosx cos15y.cosx cosy.cos3x cos3y.cos3x cos5y.cos3x cos7y.cos3x cos9y.cos3x cos11y.cos3x cos13y.cos3x cos15y.cos3x cosy.cos5x cos3y.cos5x cos5y.cos5x cos7y.cos5x cos9y.cos5x cos11y.cos5x cos13y.cos5x cos15y.cos5x cosy.cos7x cos3y.cos7x cos5y.cos7x cos7y.cos7x cos9y.cos7x cos11y.cos7x cos13y.cos7x cos15y.cos7x cosy.cos9x cos3y.cos9x cos5y.cos9x cos7y.cos9x cos9y.cos9x cos11y.cos9x cos13y.cos9x cos15y.cos9x cosy.cos11x cos3y.cos11x cos5y.cos11x cos7y.cos11x cos9y.cos11x cos11y.cos11x cos13y.cos11x cos15y.cos11x cosy.cos13x cos3y.cos13x cos5y.cos13x cos7y.cos13x cos9y.cos13x cos11y.cos13x cos13y.cos13x cos15y.cos13x cosy.cos15x cos3y.cos15x cos5y.cos15x cos7y.cos15x cos9y.cos15x cos11y.cos15x cos13y.cos15x cos15y.cos15x Remark: transpose the matrix (exchange lines and columns) This is a typing error

Basic DCT functions y=u.π/16 and x=v. π/16 F0,0 is the sum of the multiplication of elements Do not forget the constant 1 f00 f01 f02 f03 f04 f05 f06 f07 f10 f11 f12 f13 f14 f15 f16 f17 f20 f21 f22 f23 f24 f25 f26 f27 f30 f31 f32 f33 f34 f35 f36 f37 f40 f41 f42 f43 f44 f45 f46 f47 f50 f51 f52 f53 f54 f55 f56 f57 f60 f61 f62 f63 f64 f65 f66 f67 f70 f71 f72 f73 f74 f75 f76 f77 Mask

Basic DCT functions F0,1 is the sum of the multiplication of elements cos(π/16) cos(3π/16) cos(5π/16) cos(7π/16) cos(9π/16) cos(11π/16) cos(13π/16) cos(15π/16) Remark: transpose the matrix (exchange lines and columns) This is a typing error

Basic DCT functions F1,0 is the sum of the multiplication of elements cos(π/16) cos(3π/16) cos(5π/16) cos(7π/16) cos(9π/16) cos(11π/16) cos(13π/16) cos(15π/16) Remark: transpose the matrix (exchange lines and columns) This is a typing error

Basic DCT functions F2,0 is the sum of the multiplication of elements y=2π/16=π/8 and x=0 cos(π/8) cos(3π/8) cos(5π/8) cos(7π/8) cos(9π/8) cos(11π/8) cos(13π/8) cos(15π/8) cos(13π/86) cos(13π/8 Remark: transpose the matrix (exchange lines and columns) This is a typing error

Discrete Cosine Transform DCT Choose a homogeneous block

Discrete Cosine Transform DCT Choose a block rich in texture

Discrete Cosine Transform DCT It is observed that the coefficients of high absolute value are located on top and left The importance of the coefficients for the reconstruction of the image decreases as you move diagonally from top left to bottom right that corresponds to high frequencies To which the eye is the least sensitive

Inverse Discrete Cosine Transform IDCT It is possible to restore the image by the inverse process IDCT Note that in theory the DCT does not introduce any loss of information on the image The original block can be reconstructed without loss by using the Inverse DCT In fact, the DCT coefficients, i.e. those seen in the matrix of arrival are rounded to the nearest By making the transformation using Inverse DCT, we can observe slight differences between the treated matrix and the initial matrix

Quantization In signal processing, quantization can approximate a continuous signal (or values in a discrete set of large size) by the values of a discrete set of relatively small size Quantization: reducing the number of distinct values in the source data must undergo a compression Quantization algorithms allow the partitioning of data values The quantization is a primary source for loss of data in lossy compression methods

Quantization Quantization of a signal

Quantization Types Uniform Scalar Quantizer is the simplest type of quantizer, where the intervals are constant length. Quantization step is fixed

Quantization Types Uniform Quantization All intervals are the same size, except sometimes the two extremes (longer) Non Quantized Uniform Quantization

Quantization Types Non-uniform Adaptive Quantization Non-uniform: intervals may have different sizes (ex: Laplacien, Gaussian) Adaptive: the sets of intervals are calculated for each block of coefficients Non Quantized Adaptive Laplacien Quantization

Quantization of DCT coefficients Quantification is a simple Euclidean division of DCT coefficients by a divider (step), which replaces the original coefficients by the quotient of division this is the stage at which we will lose some of the information DCT ranges the coefficients in order of importance Those coding for the low frequencies towards the upper left corner, while less important towards the lower right corner of the matrix It takes relatively small steps for the important values and increasingly large steps as we descend to the bottom right of the matrix

Quantization of DCT coefficients The set of steps that is used for quantization is called a quantization matrix Some of these matrices were built according to psycho-visual criteria, but most follow this little formula: Q (i, j) = 1 + (1 + i + j) x Fq We will consider Fq = 5 It is a quality factor, it can be little changed in some software such as Photoshop The quantization matrix can be given as a result of psychophysical studies, with the goal of maximizing the compression ratio while minimizing perceptual losses in JPEG images. The quantization matrix which is created from this formula, does not need to be stored with the image: this allows a considerable gain in weight simply because it is sufficient to add the formula to the file header. During decompression, de-quantization is required using simple calculation prior to recreating the matrix from the formula.

Quantization of DCT coefficients Quantization of the first block of Lena with some quantization matrix Quantization matrix Transformed matrix Quantized matrix

Quantization of DCT coefficients Quantization of the second block of Lena with some quantization matrix

Coding The third step is to compress, this time without loss, the quantized matrix that we have JPEG uses a VLC (Variable Length Code) coding type: Huffman coding The Experts Group JPEG has chosen to treat zeros in a special way because of their big number It uses a special scanning for larger possible sequences of zeros This method is called the zig-zag sequence

Coding It uses the zig-zag method, by which you count the longest possible sequence of zeros.

Decompression Decompression is performed by doing the opposite: all operations are reversible, but the quantization that causes the loss We finally found a matrix very close to the first

Decompression – Example 1: Matrix after division of F(u,v) by the quantization matrix 2: Matrix after Multiplication of 1 by the quantization matrix 3: Matrix after applying the Inverse Discrete Cosine Transform (IDCT) 4: Error measure of the reconstructed matrix with the original one.

Decompression – Example 1: Matrix after division of F(u,v) by the quantization matrix 2: Matrix after Multiplication of 1 by the quantization matrix 3: Matrix after applying the Inverse Discrete Cosine Transform (IDCT) 4: Error measure of the reconstructed matrix with the original one.