Chapter 5 Bitmapped Images Multimedia Systems. Key Points For displayed images, physical dimension = pixel dimension/device resolution. For displayed.

Slides:



Advertisements
Similar presentations
T.Sharon-A.Frank 1 Multimedia Compression Basics.
Advertisements

Digital Color 24-bit Color Indexed Color Image file compression
Image Data Representations and Standards
Chapter 7 End-to-End Data
SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
Multimedia for the Web: Creating Digital Excitement Multimedia Element -- Graphics.
Nigel Chapman & Jenny Chapman
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.
Introduction to Computer Graphics
©Brooks/Cole, 2003 Chapter 15 Data Compression. ©Brooks/Cole, 2003 Realize the need for data compression. Differentiate between lossless and lossy compression.
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 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.
Lecture 3. Fundamentals of Computer Graphics. Computer Graphics, a very broad term Fields Related to Computer Graphics Bitmap/Vector graphics, 2D/3D graphics,
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.
Lecture 4 - Introduction to Computer Graphics
Klara Nahrstedt Spring 2011
Multimedia Data DCT Image Compression
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.
1 Classification of Compression Methods. 2 Data Compression  A means of reducing the size of blocks of data by removing  Unused material: e.g.) silence.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 3 This presentation © 2004, MacAvon Media Productions Introduction to Computer Graphics.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 5 This presentation © 2004, MacAvon Media Productions Bitmapped Images.
Digital Media Dr. Jim Rowan ITEC 2110 Bitmapped Images.
Digital Image Processing Image Compression
Digital Media Dr. Jim Rowan ITEC 2110 Bitmapped Images.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
Digital Media Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 5 Lecture 5 - Bitmapped Images.
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.
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.
JPEG.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
 Lecture 4. Image Resolution  The resolution of an image is the number of pixels per unit length (pixels/inch or pixels/cm).  You must change either.
Introduction to JPEG m Akram Ben Ahmed
Image File Formats Harrow Computer Club – Wed, 1 Dec 2010 Bob Watson MA CMath MIMA MBCS.
Digital Media Dr. Jim Rowan ITEC 2110 Bitmapped Images.
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.
Digital Media Dr. Jim Rowan ITEC 2110 Bitmapped Images.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM D IGITAL S TILL I MAGES Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny Winter.
 The concept of resolution is simple, but it differ according to where it is used.
Masaki Hayashi 2015, Autumn Visualization with 3D CG Digital 2D Image Basic.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM D IGITAL S TILL I MAGES Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny Winter.
BITMAPPED IMAGES & VECTOR DRAWN GRAPHICS
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
Digital Image Processing Lecture 21: Lossy Compression
Digital 2D Image Basic Masaki Hayashi
Chapter III, Desktop Imaging Systems and Issues: Lesson IV Working With Images
Chapter 7.2: Layer 5: Compression
Dr. Jim Rowan ITEC 2110 Bitmapped Images
Dr. Jim Rowan ITEC 2110 Bitmapped Images
Image Compression Techniques
The JPEG Standard.
Image Coding and Compression
Chapter 8 – Compression Aims: Outline the objectives of compression.
Lecture 5 - Bitmapped Images
Review and Importance CS 111.
Presentation transcript:

Chapter 5 Bitmapped Images Multimedia Systems

Key Points For displayed images, physical dimension = pixel dimension/device resolution. For displayed images, physical dimension = pixel dimension/device resolution. To display an image at its natural size it is scaled by device resolution/image resolution. To display an image at its natural size it is scaled by device resolution/image resolution. Downsampled images may look better than images stored at device resolution. Downsampled images may look better than images stored at device resolution.

Key Points Lossless compression: no information is lost during a compression/decompression cycle. Lossy compression: some information is discarded during the compression process. Lossless compression: no information is lost during a compression/decompression cycle. Lossy compression: some information is discarded during the compression process. Run-length encoding (RLE), Huffman encoding, and LZ77, LZ78 and LZW are lossless methods. GIFs use LZW. Run-length encoding (RLE), Huffman encoding, and LZ77, LZ78 and LZW are lossless methods. GIFs use LZW. JPEG compression is based on the use of the Discrete Cosine Transform (DCT). It is the most important lossy method for images. JPEG compression is based on the use of the Discrete Cosine Transform (DCT). It is the most important lossy method for images.

Key Points GIFs are best for simple shapes with areas of flat colour. JPEGs are best for photographs and other images with continuous tones. GIFs are best for simple shapes with areas of flat colour. JPEGs are best for photographs and other images with continuous tones. Selecting an area of pixels defines a mask which protects the rest of the image from changes that are applied. Selecting an area of pixels defines a mask which protects the rest of the image from changes that are applied. A grey-scale mask is called an alpha channel and can be used for feathering and compositing, amongst other things. A grey-scale mask is called an alpha channel and can be used for feathering and compositing, amongst other things. Pixel point processing: for a pixel with value p, we compute a new value p' = f(p). Brightness and contrast adjustments are common examples of pixel point processing. Pixel point processing: for a pixel with value p, we compute a new value p' = f(p). Brightness and contrast adjustments are common examples of pixel point processing.

Key Points Pixel group processing is based on a convolution process that also takes account of the values of neighboring pixels. Filters such as blurring and sharpening are the typical applications of pixel group processing. Pixel group processing is based on a convolution process that also takes account of the values of neighboring pixels. Filters such as blurring and sharpening are the typical applications of pixel group processing. In general, applying geometrical transformations to bitmapped images requires interpolation of pixels and may cause a loss of image quality. In general, applying geometrical transformations to bitmapped images requires interpolation of pixels and may cause a loss of image quality.

Resolution A measure of how finely a device approximates continuous images using finite pixels A measure of how finely a device approximates continuous images using finite pixels Dots per inch (dpi) Dots per inch (dpi) Printer: 600 dpi Printer: 600 dpi imagesetter (book production): dpi imagesetter (book production): dpi Scanner: dpi Scanner: dpi Drum scanners, transparency scanners: higher resolution Drum scanners, transparency scanners: higher resolution Lines per inch Lines per inch Colour printer of 150 lines per inch Colour printer of 150 lines per inch As much as 5 times lower than number of DPI As much as 5 times lower than number of DPI Frame size Frame size NTSC: 640 by 480 NTSC: 640 by 480 PAL: 768 by 576 PAL: 768 by 576 Computer monitors Computer monitors VGA: 640 by 480 VGA: 640 by by by 768 Dots per inch, 72 dpi Dots per inch, 72 dpi

Resolution Physical dimension Physical dimension physical dimension = pixel dimension / device resolution where device resolution is measured in pixels per unit length where device resolution is measured in pixels per unit length Image has pixel dimensions(ex. 300 by 200 pixels), but no physical dimension Image has pixel dimensions(ex. 300 by 200 pixels), but no physical dimension To display image at its natural size, record its pixels per inch (ppi) To display image at its natural size, record its pixels per inch (ppi)

Resolution If image's resolution < display device's resolution then interpolation of device's pixels (scaled up) If image's resolution < display device's resolution then interpolation of device's pixels (scaled up) If image's resolution > display device's resolution then discard image pixels (downsampling) If image's resolution > display device's resolution then discard image pixels (downsampling) Oversampling Oversampling Sampling images at a higher resolution than its ultimately displayed Sampling images at a higher resolution than its ultimately displayed Web browsers are poor at down-sampling Web browsers are poor at down-sampling down-sampling in advance down-sampling in advance

Image Compression Original data Compressed data encodedecode Lossless compression No information is lost Run-length encoding  Huffman coding  LZ77, LZ78, LZW,… Original data Compressed data Decompressed data encodedecode Lossy compression Discard some information JPEG

Lossless Compression Run-length encoding (RLE) Run-length encoding (RLE) replacing a run of consecutive pixels of the same color by color value and its count replacing a run of consecutive pixels of the same color by color value and its count ex ; 1 2 ; 0 2 ex ; 1 2 ; 0 2 encode color valuecount

Lossless Compression Huffman coding Huffman coding Using variable-length codes (VLC) according to its occurrence times Using variable-length codes (VLC) according to its occurrence times The more frequently it appears, the less code length it requires, and vice versa The more frequently it appears, the less code length it requires, and vice versa Dictionary-based compression Dictionary-based compression Construction a dictionary of strings, all occurrences of a string are replaced by a pointer into the dictionary Construction a dictionary of strings, all occurrences of a string are replaced by a pointer into the dictionary LZ77, LZ78, LZW (a variation of LZ78), … LZ77, LZ78, LZW (a variation of LZ78), … LZW: patented by Unisys LZW: patented by Unisys GIF: LZW, PNG: LZ77, PKZIP: LZ77 GIF: LZW, PNG: LZ77, PKZIP: LZ77

JPEG Compression JPEG JPEG Develop by Joint Photographic Experts Group Develop by Joint Photographic Experts Group Collaboration between ISO and CCITT (now ITU) Collaboration between ISO and CCITT (now ITU) Suit to compress digit photographs and bitmapped images Suit to compress digit photographs and bitmapped images Most widely known standard for lossy image compression Most widely known standard for lossy image compression

JPEG Encoding Step Shift pixel value (0~255 => -128~127) Shift pixel value (0~255 => -128~127) Divide image into blocks of size 8  8 Divide image into blocks of size 8  8 Use Discrete Cosine Transform (DCT) for each blocks Use Discrete Cosine Transform (DCT) for each blocks Quantize coefficients in block Quantize coefficients in block Apply Huffman codes for quantized coefficient Apply Huffman codes for quantized coefficient

Discrete Cosine Transform DCT of an N  N pixel image DCT of an N  N pixel image  DCT uv = Where 0 <= u < N, 0 <= v < N, 1 / 2 for u, v = 0 1 otherwise p xy is the pixel value of x, y coordinate C u, C v =

Quantization Discard high frequencies information which do not contribute much perceived quality Discard high frequencies information which do not contribute much perceived quality Sample quantization table DCT coefficients in frequency domain After quantization low high Quantize

JPEG Encoding After quantization After quantization Many components end up with zero coefficients Many components end up with zero coefficients Fewer bits are needed to store non-zero coefficients Fewer bits are needed to store non-zero coefficients Zeros are run-length encoded Zeros are run-length encoded Scan with zig-zag sequence to max the length of runs of zeroes Scan with zig-zag sequence to max the length of runs of zeroes Apply Huffman coding Apply Huffman coding

JPEG Encoding Example An 8 * 8 block Shift & DCT transform DCT coefficients in frequency domain Quantization After using quantization table on coefficients Zig-zag scan Follow the scan to code coefficients

JPEG Decoding How to Decompression ? Just reverse compression process sequence! (but there is some information lost!) Frequency domain after decompression Original frequency domain

Compression Artefact Original image After JPEG compression (Produced by Photoshop)

Image Manipulation Why manipulate image? Why manipulate image? Correct deficiencies caused by creation or digitization Correct deficiencies caused by creation or digitization ex. Red-eye removal ex. Red-eye removal Create unnatural image Create unnatural image ex. Creating a glow around an object ex. Creating a glow around an object Image manipulation program Image manipulation program Adobe Photoshop, PhotoImpact Adobe Photoshop, PhotoImpact

Selections, Masks and Alpha Channels Selection Selection Defining an area within the image Defining an area within the image Tools Tools rectangular or elliptical marquee, lasso, rectangular or elliptical marquee, lasso, magic wand, and magnetic lasso Photoshop tools Elliptical marquee lasso magic wand

Selections, Masks and Alpha Channels Mask Mask The unselected area protect from any changes you make to the image The unselected area protect from any changes you make to the image Use single bit for each pixel: ‘1’ for all masked out pixels and ‘0’ for selection Use single bit for each pixel: ‘1’ for all masked out pixels and ‘0’ for selection Alpha channel Alpha channel Using more than one bit to specify transparency Using more than one bit to specify transparency compute composited image of a pixel p compute composited image of a pixel p where p 1, p 2 : the values of pixels in two original images α : normalized to lie between 0 and 1 α : normalized to lie between 0 and 1 p = αp 1 + (1 – α)p 2

Pixel Point Processing Compute a pixel’s new value p’ on its old value p, without regard to other pixel Compute a pixel’s new value p’ on its old value p, without regard to other pixel where f: mapping function ex. Construction a negative from greyscale(0~255) image f(p) = p f(p) = p p’ = f(p)

Pixel Point Processing Colour correction and alteration Colour correction and alteration Brightness Brightness Adjust the value of each pixel up or down uniformly Adjust the value of each pixel up or down uniformly Increasing makes every pixel lighter, decreasing make darker Increasing makes every pixel lighter, decreasing make darker Contrast Contrast Adjust the range between lightest and darkest areas of the image Adjust the range between lightest and darkest areas of the image Increasing contrast makes light areas lighter and dark areas darker, and vice versa Increasing contrast makes light areas lighter and dark areas darker, and vice versa Fig. 5.9 S-curve for enhancing contrast Fig. 5.9 S-curve for enhancing contrast

Pixel Group Processing Computing each pixel’s new value as a function of old value and neighboring pixels Computing each pixel’s new value as a function of old value and neighboring pixels Original Image Convolution mask New image Convolution kernel * =  ( ) i

Pixel Group Processing Original image Convolution mask New image a b c d h ef gi p (x,y) p’ = ap x-1,y+1 + bp x,y+1 + cp x+1,y+1 + dp x-1,y + ep x,y + fp x+1,y + gp x-1,y-1 + hp x,y-1 + ip x+1,y-1 p’

Filter Blur Blur Filter Filter ex. ex. In signal processing, smoothing effect is obtained by filtering out high frequencies (low pass filter) In signal processing, smoothing effect is obtained by filtering out high frequencies (low pass filter) 1/9 1/9 1/ /9 1/9 1/9 *

Filter Gaussian blur Gaussian blur Gaussian bell curve Gaussian bell curve Roughly 70% contribution to the centre pixel Roughly 70% contribution to the centre pixel Sharpen Sharpen Filter Filter ex. ex *

Filter Unsharp masking Unsharp masking Accentuate the edges, but retain the other parts Accentuate the edges, but retain the other parts Idea Idea Blurring filters out high frequencies Blurring filters out high frequencies If remove blurred image away from origin, it left high frequencies – the sharp edges If remove blurred image away from origin, it left high frequencies – the sharp edges Step Step Copy original image, applying a Gaussian blur to it Copy original image, applying a Gaussian blur to it Subtracting the blurred mask pixel value from original pixel value with scaling factor Subtracting the blurred mask pixel value from original pixel value with scaling factor

origin blur sharp Unsharp mask (Produced by Photoshop)

Filter Image I blur Image I’Image I’’ sharp Image I blur Image I’Image I’’ sharp Is I = I’’ ?

Geometrical Transformations Scaling, translation, reflection, rotation and shearing Scaling, translation, reflection, rotation and shearing Two transformation schemes Two transformation schemes Forward mapping Forward mapping Assign original pixel value to transformed pixel Assign original pixel value to transformed pixel Inverse mapping Inverse mapping For each transformed pixel, find its inverse pixel value in original image For each transformed pixel, find its inverse pixel value in original image Advantage Advantage No missing pixels No missing pixels Disadvantage Disadvantage Require inverse mapping Require inverse mapping

Sampling Methods of Inverse Mapping P1P1 P2P2 P3P3 P4P4 If transformed pixel ‘X’ locates among P 1, P 2, P 3 and P 4  Nearest neighbor method: I(‘X’) = I(P 3 ) where I(p) is the intensity value of pixel p  Bi-linear interpolation: I(‘X’) = (1-a)(1-b)I( P 1 ) + a(1-b)I(P 2 ) + (1-a)bI(P 3 ) + abI(P 4 ) where a, b are the fractional parts of ‘X’  Bi-cubic interpolation: based on cubic splines

Original image * 2 Bi-linear interpolation Bi-cubic interpolation