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

Similar documents
UNIT 7C Data Representation: Images and Sound

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 Principles of Computing, Carnegie Mellon University CORTINA/GUNA

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

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

15110 Principles of Computing, Carnegie Mellon University

15110 Principles of Computing, Carnegie Mellon University

Raster Image File Formats

INTRODUCTION TO COMPUTER GRAPHICS

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

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

Fundamentals of Multimedia

Byte = More common: 8 bits = 1 byte Abbreviation:

PENGENALAN TEKNIK TELEKOMUNIKASI CLO

Lecture - 3. by Shahid Farid

1. Describe how a graphic would be stored in memory using a bit-mapped graphics package.

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

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

LECTURE 02 IMAGE AND GRAPHICS

Image Perception & 2D Images

A picture is worth a thousand words

An Analytical Study on Comparison of Different Image Compression Formats

CS 262 Lecture 01: Digital Images and Video. John Magee Some material copyright Jones and Bartlett

Digital Asset Management 2. Introduction to Digital Media Format

Graphics for Web. Desain Web Sistem Informasi PTIIK UB

A Hybrid Technique for Image Compression

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

Bitmap Image Formats

1. Using Images on Web Pages 2. Image Formats 3. Bitmap Image Formats

UNIT 7B Data Representa1on: Images and Sound. Pixels. An image is stored in a computer as a sequence of pixels, picture elements.

Two Basic Digital Camera Types ( ) ( )

A Brief Introduction to Information Theory and Lossless Coding

MULTIMEDIA SYSTEMS

What You ll Learn Today

4 Images and Graphics

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Picsel epage. Bitmap Image file format support

Indexed Color. A browser may support only a certain number of specific colors, creating a palette from which to choose

LECTURE VI: LOSSLESS COMPRESSION ALGORITHMS DR. OUIEM BCHIR

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

Images and Colour COSC342. Lecture 2 2 March 2015

Anti aliasing and Graphics Formats

Digital Image Processing Introduction

REVIEW OF IMAGE COMPRESSION TECHNIQUES FOR MULTIMEDIA IMAGES

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

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

LECTURE 03 BITMAP IMAGE FORMATS

Unit 1.1: Information representation

Scientific Working Group on Digital Evidence

Common File Formats. Need to store an image on disk Real photos Synthetic renderings Composed images. Desirable Features High quality.

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

ISO/TR TECHNICAL REPORT. Document management Electronic imaging Guidance for the selection of document image compression methods

Understanding Image Formats And When to Use Them

Chapter 9 Image Compression Standards

Digital Image Fundamentals

Starting a Digitization Project: Basic Requirements

CSC 170 Introduction to Computers and Their Applications. Lecture #3 Digital Graphics and Video Basics. Bitmap Basics

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

Prof. Feng Liu. Fall /02/2018

Hybrid Coding (JPEG) Image Color Transform Preparation

Assistant Lecturer Sama S. Samaan

CS101 Lecture 19: Digital Images. John Magee 18 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

A SURVEY ON DICOM IMAGE COMPRESSION AND DECOMPRESSION TECHNIQUES

Factors to Consider When Choosing a File Type

Raster (Bitmap) Graphic File Formats & Standards

An Enhanced Approach in Run Length Encoding Scheme (EARLE)

4/9/2015. Simple Graphics and Image Processing. Simple Graphics. Overview of Turtle Graphics (continued) Overview of Turtle Graphics

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

Digital imaging or digital image acquisition is the creation of digital images, typically from a physical scene. The term is often assumed to imply

Information representation

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

BEST PRACTICES FOR SCANNING DOCUMENTS. By Frank Harrell

image Scanner, digital camera, media, brushes,

HTTP transaction with Graphics HTML file + two graphics files

CHAPTER 3 I M A G E S

Ch. 3: Image Compression Multimedia Systems

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

2. REVIEW OF LITERATURE

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

Bit Depth. Introduction

The Basics of Digital Imaging

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

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

Know your digital image files

Information Hiding: Steganography & Steganalysis

IMAGE SIZING AND RESOLUTION. MyGraphicsLab: Adobe Photoshop CS6 ACA Certification Preparation for Visual Communication

Huffman Coding For Digital Photography

Indian Institute of Technology, Roorkee, India

Image Processing. Adrien Treuille

Introduction. Prof. Lina Karam School of Electrical, Computer, & Energy Engineering Arizona State University

PB Works e-portfolio Optimizing Photographs using Paintshop Pro 9

Learning Outcomes. Black and White pictures. Bitmap Graphics. COMPSCI 111/111G Digital Images and Vector Graphics

Glossary Unit 1: Hardware/Software & Storage Media

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

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

COMPSCI 111 / 111G Mastering Cyberspace: An introduction to practical computing. Digital Images Vector Graphics

Introduction to Photography

Digitizing Color. Place Value in a Decimal Number. Place Value in a Binary Number. Chapter 11: Light, Sound, Magic: Representing Multimedia Digitally

Subjective evaluation of image color damage based on JPEG compression

Multimedia-Systems: Image & Graphics

Transcription:

The Need for Data Compression Data Compression (for Images) -Compressing Graphical Data Graphical images in bitmap format take a lot of memory e.g. 1024 x 768 pixels x 24 bits-per-pixel = 2.4Mbyte =18,874,368 bits 16 Mega pixel RAW format from a camera = 20Mbytes But 100s of Gbyte /1-4 Terabytes hard drives are now readily available!! So why do we need to compress? How long did that graphics-intensive web page take to download? Even over a broadband connection it could be slow How many images can your digital camera hold? Picture messaging over mobile phones? On 3G or 4G CD (650Mb) can only hold less than 10 seconds of uncompressed video (and DVD only a few minutes) We need to make graphical image data as small as possible for many applications University 93 University 94 Types of Compression Pixel packing RLE (run-length encoding) Dictionary-based methods JPEG compression Factors to look out for: Lossy or lossless compression? What sort of data is a method good at compressing? What is its compression ratio? Richardson, Chapter 6; Chapman & Chapman, Chapter 5 Lossy vs Lossless compression Lossless compression implies that one can recreate the original data precisely. Usable anywhere, Critical for e.g. documents, binary programs, etc. Where a single bit error can render the file useless Usually requires significant processing to re-create original Lossy compression implies that one cannot recreate the precise original But one can re-create something almost as good Useful for images, sounds, where what matters is the percept, not precise bit-for-bit re-creation Some processing required but can be less than lossless approach 95 96

Pixel Packing Not a standard data compression technique but nevertheless a way of not wasting space in pixel data e.g. suppose pixels can take grey values from 0-15 each pixel requires half a byte but computers prefer to deal with bytes two pixels per byte doesn t waste space Pixel packing is simply ensuring no bits are wasted in the pixel data (Lossless if assumption true) 97 Run-Length Encoding A sequence of the same values is stored as a repetition count and the value: AAAAAAAAAAAAAAA would encode as 15A AAAAAACCCBBBBBD = 6A 3C 5B 1D This works best for large expanses of the same colour, or does it? consider the image below: the small 10 x 11 block has 59 different colours the full (371x247 bitmap) image is 275 Kb raw data the RLE-compressed image is 91 Kbytes (3:1 ratio) RLE compression ratios not good in general, because there are rarely repeat runs of pixels University 98 RLE compression ratio Another example, with a diagram this time Full image: 350 264 bitmap 277Kb raw data (277200 = 350 264 3) bytes 46.5K RLE encoded Compression ratio approx 6:1 in this case (Of course, if the data had been held as vectors and text, it would have been much smaller!) 99 Dictionary Methods A common way to compress data (pixels, characters, whatever!) is to use a dictionary The dictionary contains strings of bytes e.g. particular pixel patterns not limited to patterns of one colour, as with RLE Data is encoded by replacing each data string that has an entry in the dictionary with its index number in the dictionary Shorter to write an index number than a whole string! (what are the implicit assumptions here?) Dictionary may be particular to the image, or may be standard for particular image types 100

Patterns of Pixels Poor results with RLE as runs of pixels with same colour are very short But there are repeating patterns with two colours that could be included in a dictionary Trade-off between pattern size and likelihood of being in the dictionary Huffman and CCITT Compression Developed for fax machines and document scanners Uses a predefined dictionary of commonly occurring byte patterns from B&W documents containing large amounts of text in a variety of languages and typical examples of line art Commonly occurring patterns are given low indices (coded using short codes) in the dictionary Data is encoded by replacing each image string that occurs in the dictionary with its index number Dictionary is not part of the compressed file. 101 102 The Lempel-Ziv-Welch Algorithm When Is LZW Useful? The Lempel-Ziv-Welch method is another such dictionary algorithm, in which the dictionary is constructed as the encoding (compression) progresses (actually Ziv was the first author on the original papers!) LZW starts with a dictionary of byte strings: Entries 0-255 refer to those individual bytes Entries 256 onwards will be defined as the algorithm progresses Each time a new code is generated it means a new string of bytes has been found. New strings are generated by appending a byte c to the end of an existing string w Single pass algorithm Good for encoding pixel data with a limited palette, and/or repetitive data line drawings diagrams plain text on a plain background Not good for photographic images large colour range and complex features results in few repeating patterns to include in a dictionary Lossless and fast 103 104

JPEG Joint Photographic Experts Group Designed to compress photographs colour or greyscale good at compressing real scenes not good for line drawings, diagrams, lettering, cartoons Designed for human viewing, exploits our inability to see a full range of colours Lossy algorithm Not good for computer analysis of data e.g. medical imaging May throw away vital data! 105 JPEG Compression Compression steps: transform to brightness/colour model (e.g. HSB) down-sample the colour values (reduce their scale) split brightness/colour maps into 8 x 8 pixel blocks identify spatial frequencies in these blocks quantise frequency values using a Q factor store discrete values efficiently (e.g. RLE) Different Q (Quantisation) factors give different compression ratios: 10:1 to 20:1 reasonable, 100:1 for low quality Trade-off of quality versus size of compressed data Data is lost on (de/re)compression (from quantization processes) University 106 JPEG Examples 15:1 photo compression: JPEG tries to smooth sharp boundaries, e.g. the edges of letters (Text / background boundary is a high spatial frequency - JPEG attempts to smooth this with poor results!!) JPEG Compression How good is it? For full-colour images, the best-known lossless compression gives about 2:1 compression For reasonable quality, compression ratios of 10:1 or 20:1 quite feasible for JPEGs Clive s picture compressed with a ratio of 15:1 For poor quality images (thumbnails?), 100:1 possible Repeating the process with subsequent re-encoding loses more information University 107 108

Compressing Images LZW: good for a limited palette and repeated patterns e.g. plain text on a plain background, line drawings and diagrams not good for photos due to many colours and complex patterns JPEG: designed for colour or grayscale photos compression is lossy good for natural scenes not good for line drawings, diagrams or cartoons University 109 Video Compression/How Do We Compress Movies? Compress individual frames using any of the techniques mentioned already spatial compression High, lossy compression is OK as the quality of individual frames can be lower than for still images as our perception is dominated by motion Make use of limited changes between frames key frames difference frames temporal compression More on this in a later lecture University 110