Image Processing Computer Graphics I Lecture 20. Display Color Models Filters Dithering Image Compression

Similar documents
Image Processing. Adrien Treuille

Compression and Image Formats

Chapter 9 Image Compression Standards

Images with (a) coding redundancy; (b) spatial redundancy; (c) irrelevant information

ECE/OPTI533 Digital Image Processing class notes 288 Dr. Robert A. Schowengerdt 2003

2.1. General Purpose Run Length Encoding Relative Encoding Tokanization or Pattern Substitution

Fundamentals of Multimedia

CGT 511. Image. Image. Digital Image. 2D intensity light function z=f(x,y) defined over a square 0 x,y 1. the value of z can be:

UNIT 7C Data Representation: Images and Sound

Module 6 STILL IMAGE COMPRESSION STANDARDS

UNIT 7C Data Representation: Images and Sound Principles of Computing, Carnegie Mellon University CORTINA/GUNA

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

15110 Principles of Computing, Carnegie Mellon University

Computer Graphics. Si Lu. Fall er_graphics.htm 10/02/2015

15110 Principles of Computing, Carnegie Mellon University

Ch. 3: Image Compression Multimedia Systems

Images and Graphics. 4. Images and Graphics - Copyright Denis Hamelin - Ryerson University

Image Processing COS 426

Digital Media. Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr.

The Need for Data Compression. Data Compression (for Images) -Compressing Graphical Data. Lossy vs Lossless compression

SYLLABUS CHAPTER - 2 : INTENSITY TRANSFORMATIONS. Some Basic Intensity Transformation Functions, Histogram Processing.

Multimedia-Systems: Image & Graphics

LECTURE 02 IMAGE AND GRAPHICS

Assistant Lecturer Sama S. Samaan

2. REVIEW OF LITERATURE

Lecture - 3. by Shahid Farid

The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D.

The Strengths and Weaknesses of Different Image Compression Methods. Samuel Teare and Brady Jacobson

Color & Compression. Robin Strand Centre for Image analysis Swedish University of Agricultural Sciences Uppsala University

REVIEW OF IMAGE COMPRESSION TECHNIQUES FOR MULTIMEDIA IMAGES

Prof. Feng Liu. Fall /04/2018

MULTIMEDIA SYSTEMS

Prof. Feng Liu. Fall /02/2018

image Scanner, digital camera, media, brushes,

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

Digital Image Processing Introduction

What is an image? Bernd Girod: EE368 Digital Image Processing Pixel Operations no. 1. A digital image can be written as a matrix

Camera Image Processing Pipeline: Part II

The next table shows the suitability of each format to particular applications.

Lossy and Lossless Compression using Various Algorithms

Multimedia Systems Entropy Coding Mahdi Amiri February 2011 Sharif University of Technology

Image Processing. Image Processing. What is an Image? Image Resolution. Overview. Sources of Error. Filtering Blur Detect edges

A SURVEY ON DICOM IMAGE COMPRESSION AND DECOMPRESSION TECHNIQUES

4 Images and Graphics

Camera Image Processing Pipeline: Part II

Digital Image Fundamentals

Bitmap Vs Vector Graphics Web-safe Colours Image compression Web graphics formats Anti-aliasing Dithering & Banding Image issues for the Web

Sampling Rate = Resolution Quantization Level = Color Depth = Bit Depth = Number of Colors

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Compression. Encryption. Decryption. Decompression. Presentation of Information to client site

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad

INTRODUCTION TO COMPUTER GRAPHICS

Hybrid Coding (JPEG) Image Color Transform Preparation

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Bitmap Image Formats

Digital Image Processing Question Bank UNIT -I

INTRODUCTION TO IMAGE PROCESSING

IMAGES AND COLOR. N. C. State University. CSC557 Multimedia Computing and Networking. Fall Lecture # 10

An Analytical Study on Comparison of Different Image Compression Formats

3. Image Formats. Figure1:Example of bitmap and Vector representation images

Raster Image File Formats

Anna University, Chennai B.E./B.TECH DEGREE EXAMINATION, MAY/JUNE 2013 Seventh Semester

EE482: Digital Signal Processing Applications

Image Processing. Michael Kazhdan ( /657) HB Ch FvDFH Ch. 13.1

OFFSET AND NOISE COMPENSATION

Subjective evaluation of image color damage based on JPEG compression

Teaching Scheme. Credits Assigned (hrs/week) Theory Practical Tutorial Theory Oral & Tutorial Total

Dr. Shahanawaj Ahamad. Dr. S.Ahamad, SWE-423, Unit-06

What You ll Learn Today

What is an image? Images and Displays. Representative display technologies. An image is:

Computer and Machine Vision

Image Processing for feature extraction

Introduction to More Advanced Steganography. John Ortiz. Crucial Security Inc. San Antonio

PRACTICAL IMAGE AND VIDEO PROCESSING USING MATLAB

Antialiasing and Related Issues

CS 4501: Introduction to Computer Vision. Filtering and Edge Detection

Digital Asset Management 2. Introduction to Digital Media Format

Images and Displays. Lecture Steve Marschner 1

CATEGORY SKILL SET REF. TASK ITEM

Topics. 1. Raster vs vector graphics. 2. File formats. 3. Purpose of use. 4. Decreasing file size

Spatial Domain Processing and Image Enhancement

Artifacts and Antiforensic Noise Removal in JPEG Compression Bismitha N 1 Anup Chandrahasan 2 Prof. Ramayan Pratap Singh 3

CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Prof. Vidya Manian Dept. of Electrical and Comptuer Engineering

Color, graphics and hardware Monitors and Display

# 12 ECE 253a Digital Image Processing Pamela Cosman 11/4/11. Introductory material for image compression

A Brief Introduction to Information Theory and Lossless Coding

Information Hiding: Steganography & Steganalysis

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Human Vision, Color and Basic Image Processing

Images and Filters. EE/CSE 576 Linda Shapiro

Announcements. Image Processing. What s an image? Images as functions. Image processing. What s a digital image?

קורס גרפיקה ממוחשבת 2008 סמסטר ב' Image Processing 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

JPEG Encoder Using Digital Image Processing

Computers and Imaging

Lossy Image Compression

B.Digital graphics. Color Models. Image Data. RGB (the additive color model) CYMK (the subtractive color model)

ECC419 IMAGE PROCESSING

Image Processing. What is an image? קורס גרפיקה ממוחשבת 2008 סמסטר ב' Converting to digital form. Sampling and Reconstruction.

Pooja Rani(M.tech) *, Sonal ** * M.Tech Student, ** Assistant Professor

Transcription:

15-462 Computer Graphics I Lecture 2 Image Processing April 18, 22 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Display Color Models Filters Dithering Image Compression

Displays and Framebuffers Image stored in memory as 2D pixel array, called framebuffer Value of each pixel controls color Video hardware scans the framebuffer at 6Hz Depth of framebuffer is information per pixel 1 bit: black and white display (cf. Smithsonian) 8 bit: 6 colors at any given time via colormap 16 bit: 5, 6, 5 bits (R,G,B), 2 16 = 65,536 colors 24 bit: 8, 8, 8 bits (R,G,B), 2 24 = 16,777,216 colors 4/18/22 15-462 Graphics I 2

Fewer Bits: Colormaps Colormaps typical for 8 bit framebuffer depth With screen 124 * 768 = 786432 =.75 MB Each pixel value is index into colormap Colormap is array of RGB values, 8 bits each All 2 24 colors can be represented Only 2 8 = 6 at a time Poor approximation of full color Who owns the colormap? Colormap hacks: affect image w/o changing framebuffer (only colormap) 4/18/22 15-462 Graphics I 3

More Bits: Graphics Hardware 24 bits: RGB + 8 bits: A (α-channel for opacity) + 16 bits: Z (for hidden-surface removal) * 2: double buffering for smooth animation = 96 bits For 124 * 768 screen: 9 MB 4/18/22 15-462 Graphics I 4

Image Processing 2D generalization of signal processing Image as a two-dimensional signal Point processing: modify pixels independently Filtering: modify based on neighborhood Compositing: combine several images Image compression: space-efficient formats Other topics (not in this course) Image enhancement and restoration Special effects (cf. Tuesday s lecture) Computer vision 4/18/22 15-462 Graphics I 5

Outline Display Color Models Filters Dithering Image Compression 4/18/22 15-462 Graphics I 6

Point Processing Input: a(x,y); Output: b(x,y) = f(a(x,y)) Useful for contrast adjustment, false colors Examples for grayscale, v 1 f(v) = v (identity) f(v) = 1-v (negate image) f(v) = v p, p < 1 (brighten) f(v) = v p, p > 1 (darken) Gamma correction compensates monitor brightness loss f(v) v 4/18/22 15-462 Graphics I 7

Gamma Correction Example Γ = 1.; f(v) = v Γ =.5; f(v) = v 1/.5 = v 2 Γ = 2.5; f(v) = v 1/2.5 = v.4 4/18/22 15-462 Graphics I 8

Signals and Filtering Audio recording is 1D signal: amplitude(t) Image is a 2D signal: color(x,y) Signals can be continuous or discrete Raster images are discrete In space: sampled in x, y In color: quantized in value Filtering: a mapping from signal to signal 4/18/22 15-462 Graphics I 9

Linear and Shift-Invariant Filters Linear with respect to input signal Shift-invariant with respect to parameter Convolution in 1D a(t) is input signal b(s) is output signal h(u) is filter Shorthand: b = a h ( = h a, as an aside) Convolution in 2D 4/18/22 15-462 Graphics I 1

Filters with Finite Support Filter h(u,v) is except in given region Represent h in form of a matrix Example: 3 3 blurring filter As function In matrix form 4/18/22 15-462 Graphics I 11

Blurring Filters Average values of surrounding pixels Can be used for anti-aliasing Size of blurring filter should be odd What do we do at the edges and corners? For noise reduction, use median, not average Eliminates intensity spikes Non-linear filter 4/18/22 15-462 Graphics I 12

Examples of Blurring Filter Original Image Blur 3x3 mask Blur 7x7 mask 4/18/22 15-462 Graphics I 13

Example Noise Reduction Original image Image with noise Median filter (5x5?) 4/18/22 15-462 Graphics I 14

Edge Filters Discover edges in image Characterized by large gradient Approximate square root Approximate partial derivatives, e.g. 4/18/22 15-462 Graphics I 15

Sobel Filter Edge detection filter, with some smoothing Approximate Sobel filter is non-linear Square and square root (more exact computation) Absolute value (faster computation) 4/18/22 15-462 Graphics I 16

4/18/22 15-462 Graphics I 17 Sample Filter Computation Sample Filter Computation Part of Sobel filter, detects vertical edges -1-1 -2 1 1 2 4 1 a b h

Example of Edge Filter Original image Edge filter, then brightened 4/18/22 15-462 Graphics I 18

Image Compositing Use α-channel (RGBA) Already discussed in this course Used for retouching and special effects Other image compositing techniques Morphing See Steve Sullivan s talk 4/18/22 15-462 Graphics I 19

Outline Display Color Models Filters Dithering Image Compression 4/18/22 15-462 Graphics I 2

Dithering Compensates for lack of color resolution Give up spatial resolution for color resolution Eye does spatial averaging Black/white dithering to achieve gray scale Each pixel is black or white From far away, color determined by fraction of white For 3x3 block, 1 levels of gray scale 4/18/22 15-462 Graphics I 21

Halftone Screens Regular patterns create some artefacts Avoid stripes Avoid isolated pixels (e.g. on laser printer) Monotonicity: keep pixels on at higher intensities Example of good 3 3 dithering matrix For intensity n, turn on pixels..n 1 4/18/22 15-462 Graphics I 22

Floyd-Steinberg Error Diffusion Approximation without fixed resolution loss Scan in raster order At each pixel, draw least error output value Divide error into 4 different fractions Add the error fractions into adjacent, unwritten pixels 7/16 3/16 5/16 1/16 4/18/22 15-462 Graphics I 23

Floyd-Steinberg Example Gray Scale Ramp Some worms Some checkerboards Enhance edges Peter Anderson 4/18/22 15-462 Graphics I 24

Color Dithering Example: 8 bit framebuffer Set color map by dividing 8 bits into 3,3,2 for RGB Blue is deemphasized since we see it less well Dither RGB separately Works well with Floyd-Steinberg Assemble results into 8 bit index into colormap Generally looks good 4/18/22 15-462 Graphics I

Outline Display Color Models Filters Dithering Image Compression 4/18/22 15-462 Graphics I 26

Image Compression Exploit redundancy Coding: some pixel values more common Interpixel: adjacent pixels often similar Psychovisual: some color differences imperceptible Distinguish lossy and lossless methods 4/18/22 15-462 Graphics I 27

Some Image File Formats Depth File Size Comments JPEG 24 Small Lossy compression TIFF 8, 24 Medium Good general purpose GIF 1, 4, 8 Medium Popular, but 8 bit PPM 24 Big Easy to read/write EPS 1,2,4,8,24 Huge Good for printing 4/18/22 15-462 Graphics I 28

Image Sizes 124*124 at 24 bits uses 3 MB Encyclopedia Britannica at 3 pixels/inch and 1 bit/pixes requires gigabytes (K pages) 9 minute movie at 64x48, 24 bits per pixels, 24 frames per second requires 12 gigabytes Applications: HDTV, DVD, satellite image transmission, medial image processing, fax,... 4/18/22 15-462 Graphics I 29

Exploiting Coding Redundancy Not limited to images (text, other digital info) Exploit nonuniform probabilities of symbols Entropy as measure of information content H = -Σ i Prob(s i ) log 2 (Prob(s i )) If source is independent random variable need H bits Idea: More frequent symbols get shorter code strings Best with high redundancy (= low entropy) Common algorithms Huffman coding LZW coding (gzip) 4/18/22 15-462 Graphics I 3

Huffman Coding Codebook is precomputed and static Use probability of each symbol to assign code Map symbol to code Store codebook and code sequence Precomputation is expensive What is symbol for image compression? 4/18/22 15-462 Graphics I 31

Lempel-Ziv-Welch (LZW) Coding Compute codebook on the fly Fast compression and decompression Can tune various parameters Both Huffman and LZW are lossless 4/18/22 15-462 Graphics I 32

Exploiting Interpixel Redundancy Neighboring pixels are correlated Spatial methods for low-noise image Run-length coding: Alternate values and run-length Good if horizontal neighbors are same Can be 1D or 2D (e.g. used in fax standard) Quadtrees: Recursively subdivide until cells are constant color Region encoding: Represent boundary curves of color-constant regions Combine methods Not good on natural images directly 4/18/22 15-462 Graphics I 33

Improving Noise Tolerance Predictive coding: Predict next pixel based on prior ones Output difference to actual Fractal image compression Describe image via recursive affine transformation Transform coding Exploit frequency domain Example: discrete cosine transform (DCT) Used in JPEG Transform coding for lossy compression 4/18/22 15-462 Graphics I 34

Discrete Cosine Transform Used for lossy compression (as in JPEG) JPEG (Joint Photographic Expert Group) Subdivide image into n n blocks (n = 8) Apply discrete cosine transform for each block Quantize, zig-zag order, run-length code coefficients Use variable length coding (e.g. Huffman) Many natural images can be compressed to 4 bits/pixels with little visible error 4/18/22 15-462 Graphics I 35

Summary Display Color Models 8 bit (colormap), 24 bit, 96 bit Filters Blur, edge detect, sharpen, despeckle Dithering Floyd-Steinberg error diffusion Image Compression Coding, interpixel, psychovisual redundancy Lossless vs. lossy compression 4/18/22 15-462 Graphics I 36

Preview Assignment 6 graded Tuesday: Scientific Visualization Assignment 7 due Tuesday Assignment 8 (written) out Tuesday 4/18/22 15-462 Graphics I 37