Image coding and compression

Similar documents
Image Coding and Compression

Data and information. Image Codning and Compression. Image compression and decompression. Definitions. Images can contain three types of redundancy

IMAGE COMPRESSION. Image Compression. Why? Reducing transportation times Reducing file size. A two way event - compression and decompression

Topic 5 Image Compression

IMAGE PROCESSING (RRY025) LECTURE 13 IMAGE COMPRESSION - I

G64PMM - Lecture 3.2. Analogue vs Digital. Analogue Media. Graphics & Still Image Representation

VC 12/13 T16 Video Compression

Fundamentals of Multimedia. Lecture 5 Lossless Data Compression Variable Length Coding

15 Data Compression 2014/9/21. Objectives After studying this chapter, the student should be able to: 15-1 LOSSLESS COMPRESSION

IMAGE COMPRESSION- I. Week VIII Feb /25/2003 Image Compression-I 1

Lecture 8 JPEG Compression (Part 3)

Image compression. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

7: Image Compression

color bit depth dithered

Logo & Icon. Fit Together Logo (color) Transome Logo (black and white) Quick Reference Print Specifications

Digital Image Processing

MULTIMEDIA AND CODING

Shafq ur Réhman Image and Video Compression

Lecture 5: Compression I. This Week s Schedule

IMAGE COMPRESSION TECHNIQUES

CS101 Lecture 12: Image Compression. What You ll Learn Today

1.6 Graphics Packages

REVIEW ON IMAGE COMPRESSION TECHNIQUES AND ADVANTAGES OF IMAGE COMPRESSION

Common File Formats. Need a standard to store images Raster data Photos Synthetic renderings. Vector Graphic Illustrations Fonts

Web Design, 5 th Edition

This is not yellow. Image Files - Center for Graphics and Geometric Computing, Technion 2

EE67I Multimedia Communication Systems Lecture 4

Simple variant of coding with a variable number of symbols and fixlength codewords.

Lecture 8 JPEG Compression (Part 3)

Image Processing Computer Graphics I Lecture 15

Image Processing. Blending. Blending in OpenGL. Image Compositing. Blending Errors. Antialiasing Revisited Computer Graphics I Lecture 15

A Novel Image Compression Technique using Simple Arithmetic Addition

HOW TO SAVE YOUR DESIGN FILES

Image, video and audio coding concepts. Roadmap. Rationale. Stefan Alfredsson. (based on material by Johan Garcia)

CS 335 Graphics and Multimedia. Image Compression

Advanced High Graphics

Department of electronics and telecommunication, J.D.I.E.T.Yavatmal, India 2

VIDEO SIGNALS. Lossless coding

Multimedia Systems Image III (Image Compression, JPEG) Mahdi Amiri April 2011 Sharif University of Technology

CMPT 365 Multimedia Systems. Media Compression - Image

Features. Sequential encoding. Progressive encoding. Hierarchical encoding. Lossless encoding using a different strategy

Repetition 1st lecture

III-6Exporting Graphics (Windows)

Data Compression. Media Signal Processing, Presentation 2. Presented By: Jahanzeb Farooq Michael Osadebey

Engineering Mathematics II Lecture 16 Compression

Video Compression An Introduction

1.Define image compression. Explain about the redundancies in a digital image.

Lecture 6: Compression II. This Week s Schedule

yintroduction to compression ytext compression yimage compression ysource encoders and destination decoders

Image Compression for Mobile Devices using Prediction and Direct Coding Approach

Format Type Support Thru. vector (with embedded bitmaps)

Compression II: Images (JPEG)

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

compression and coding ii

Image Compression. CS 6640 School of Computing University of Utah

A Image Comparative Study using DCT, Fast Fourier, Wavelet Transforms and Huffman Algorithm

Digital Image Processing

JPEG Compression Using MATLAB

A QUAD-TREE DECOMPOSITION APPROACH TO CARTOON IMAGE COMPRESSION. Yi-Chen Tsai, Ming-Sui Lee, Meiyin Shen and C.-C. Jay Kuo

Digital Image Representation Image Compression

Image Compression - An Overview Jagroop Singh 1

Compression; Error detection & correction

Operation of machine vision system

Data Compression. An overview of Compression. Multimedia Systems and Applications. Binary Image Compression. Binary Image Compression

Fundamentals of Video Compression. Video Compression

Image Compression Algorithm and JPEG Standard

Wireless Communication

Lecture Coding Theory. Source Coding. Image and Video Compression. Images: Wikipedia

Data Representation From 0s and 1s to images CPSC 101

Professor Laurence S. Dooley. School of Computing and Communications Milton Keynes, UK

ECE 499/599 Data Compression & Information Theory. Thinh Nguyen Oregon State University

Data Representation and Networking

IMAGE COMPRESSION. Chapter - 5 : (Basic)

Web graphics. Introduction

What is multimedia? Multimedia. Continuous media. Most common media types. Continuous media processing. Interactivity. What is multimedia?

Final Review. Image Processing CSE 166 Lecture 18

Index. 1. Motivation 2. Background 3. JPEG Compression The Discrete Cosine Transformation Quantization Coding 4. MPEG 5.

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

Multimedia Networking ECE 599

DjVu Technology Primer

So, what is data compression, and why do we need it?

International Journal of Computer & Organization Trends Volume 3 Issue 2 March to April 2013

JPEG. Table of Contents. Page 1 of 4

Multimedia. What is multimedia? Media types. Interchange formats. + Text +Graphics +Audio +Image +Video. Petri Vuorimaa 1

Sparse Transform Matrix at Low Complexity for Color Image Compression

13.6 FLEXIBILITY AND ADAPTABILITY OF NOAA S LOW RATE INFORMATION TRANSMISSION SYSTEM

Image Types Vector vs. Raster

AN ANALYTICAL STUDY OF LOSSY COMPRESSION TECHINIQUES ON CONTINUOUS TONE GRAPHICAL IMAGES

Introduction to Computer Science (I1100) Data Storage

IT Digital Image ProcessingVII Semester - Question Bank

Multimedia on the Web

Preview from Notesale.co.uk Page 2 of 88

Compression. storage medium/ communications network. For the purpose of this lecture, we observe the following constraints:

Frequently Asked Questions about Text and Graphics

IMAGE COMPRESSION USING FOURIER TRANSFORMS

Lossless Compression Algorithms

Brand guide template. A few things to note: Remove this page. This is an example guideline for a made up company called ACME CO.

06/12/2017. Image compression. Image compression. Image compression. Image compression. Coding redundancy: image 1 has four gray levels

Understanding file formats

Transcription:

Image coding and compression Robin Strand Centre for Image Analysis Swedish University of Agricultural Sciences Uppsala University

Today Information and Data Redundancy Image Quality Compression Coding File formats 2

Redundancy information and data Data is not the same thing as information. Data is the means with which information is expressed. The amount of data can be much larger than the amount of information. Redundant data does not provide additional information. Image coding or compression aims at reducing the amount of data while keeping the information by reducing the amount of redundancy. 3

Different Types of Redundancy 4 Coding Redundancy Some gray levels are more common than other. Interpixel redundancy The same gray level may cover a large area. Psycho-Visual Redundancy The eye can only resolve about 32 gray levels locally. M.C. Escher 1948

Image Coding and Compression 5

Image Compression Image compression can be: Reversible (lossless), with no loss of information. The image after compression and decompression is identical to the original image. Often necessary in image analysis applications. The compression ratio is typically 2 to 10 times. Non reversible (lossy), with loss of some information. Lossy compression is often used in image communication, compact cameras, video, www, etc. The compression ratio is typically 10 to 30 times. 6

Image Coding and Compression Image coding How the image data can be represented. Image compression Reducing the amount of data required to represent an image. Enabling efficient image storing and transmission. 7

Dealing with coding redundancy Basic idea: Different gray levels occur with different probability (non uniform histogram). Use shorter code words for the more common gray levels and longer code words for less common gray levels. This is called Variable Code Length. 8

Psycho-Visual Redundancy If the image will only be used for visual observation much of the information is usually psycho-visual redundant. It can be removed without changing the visual quality of the image. This kind of compression is usually lossy. 50 kb (uncompressed TIFF) 5 kb (JPEG) 9

Transform Coding Divide the image into blocks. Transform each block with discrete cosine transform or discrete Fourier transform. The transformed blocks are truncated to exclude the least important data. Code the resulting data using variable length coding, e.g., Huffman coding in a zigzag scan pattern. 10

JPEG: example of transform coding 9486 100 % s 3839 90 % 2086 80 % 1711 60 % 1287 40 % 822 20 % 11 File size in bytes JPEG quality 533 380 10 % 5%

Huffman Coding First 1. Sort the gray levels by decreasing probability 2. Sum the two smallest probabilities. 3. Sort the new value into the list. 4. Repeat 1 to 3 until only two probabilities remains. Second 1. Give the code 0 to the highest probability, and the code 1 to the lowest probability in the summed pair. 2. Go backwards through the tree one node and repeat from 1 until all gray levels have a unique code. 12

Example of Huffman coding 13

Example of Huffman coding 14

Example of Huffman coding 15

Example of Huffman coding 16

Example of Huffman coding 17

Example of Huffman coding 18

Example of Huffman coding 19

Huffman Coding First 1. Sort the gray levels by decreasing probability 2. Add the two smallest probabilities. 3. Sort the new value into the list. 4. Repeat 1 to 3 until only two probabilities remains. Second 1. Give the code 0 to the highest probability, and the code 1 to the lowest probability in the summed pair. 2. Go backwards through the tree one node and repeat from 1 until all gray levels have a unique code. 20

Example of Huffman coding Assigning codes 21

Example of Huffman coding Assigning codes 22

Example of Huffman coding Assigning codes 23

Example of Huffman coding Assigning codes 24

Example of Huffman coding Assigning codes gustaf@cb.uu.se 25

Example of Huffman coding Assigning codes 26

Example of Huffman coding Assigning codes 27

Huffman Coding 28 The Huffman code is completely reversible, i.e., lossless. The table for the translation has to be stored together with the coded image. The resulting code is unambiguous. That is, for the previous example, the encoded string 011011101011 can only be parsed into the code words 0, 110, 1110, 1011 and decoded as 7, 4, 5, 0. The Huffman code does not take correlation between adjacent pixels into consideration.

Interpixel Redundancy Also called spatial or geometric redundancy Adjacent pixels are often correlated, i.e., the value of neighboring pixels of an observed pixel can often be predicted from the value of the observed pixel. Coding methods: Run-length coding Difference coding 29

Run-length coding Every code word is made up of a pair (g,l) where g is the gray level, and l is the number of pixels with that gray level (length or run ). E.g., 56 56 56 82 82 82 83 80 56 56 56 56 56 80 80 80 creates the run-length code (56,3)(82,3)(83,1)(80,4) (56,5) The code is calculated row by row. 30

Difference Coding Keep the first pixel in a row. The rest of the pixels are stored as the difference to the previous pixel Example: original 56 56 56 82 82 82 83 80 80 80 80 code 56 0 0 26 0 0 1-3 0 0 0 The code is calculated row by row. Both run-length and difference coding are reversible and can be combined with, e.g., Huffman coding. 31

Example of Combined Difference and Huffman Coding Number of bits used to represent the gray scale values: 4 Lavg=4 32

33 Huffman Coding Lavg=3.01

Difference Coding and Huffman Coding Lavg=2 34

LZW Coding LZW, Lempel-Ziv-Welch In contrast to Huffman with variable code length LZW uses fixed lengths of code words which are assigned to variable length sequences of source symbols. The coding is done from left-to-right and row-by-row. Requires no a priori knowledge of the probability of occurrence of the symbols to be encoded. Removes some of the interpixel redundancy. During encoding a dictionary or code-book with symbol sequences is created which is recreated when decoding. 35

File Formats with Lossy Compression JPEG, Joint Photographic Experts Group, based on a cosine transform on 8x8 pixel blocks and RunLength coding. Give arise to ringing and block artifacts. (.jpg.jpe.jpeg) JPEG2000, created by the Joint Photographic Experts Group in 2000. Based on wavelet transform and is superior to JPEG. Give arise only to ringing artifacts and allows flexible decompression (progressive transmission, region of interest,...) and reading. (.jp2.jpx) 36

37 File Formats with Lossless Compression TIFF, Tagged Image File Format, flexible format often supporting up to 16 bits/pixel in 4 channels. Can use several different compression methods, e.g., Huffman, LZW. GIF, Graphics Interchange Format. Supports 8 bits/pixel in one channel, that is only 256 colors. Uses LZW compression. Supports animations. PNG, Portable Network Graphics, supports up to 16 bits/pixel in 4 channels (RGB + transparency). Uses Deflate compression (~LZW and Huffman). Good when interpixel redundancy is present.

Vector based file formats Uses predefined shapes 38

Vector based file formats PS, PostScript, is a page description language developed in 1982 for sending text documents to printers. EPS, Encapsulated PostScript, like PS but can embed raster images internally using the TIFF format. PDF, Portable Document Format, widely used for documents and are supported by a wide range of platforms. Supports embedding of fonts and raster/bitmap images. Beware of the choice of coding. Both lossy and lossless compressions are supported. SVG, Scalable Vector Graphics, based on XML supports both static and dynamic content. All major web browsers supports it. 39

Choosing image file format 40 Image analysis Lossless formats are vital. TIFF supports a wide range of different bit depths and lossless compression methods. Images for use on the web JPEG for photos (JPEG2000), PNG for illustrations. GIF for small animations. Vector format: SVG, nowadays supported by web browsers. Line art, illustrations, logotypes, etc. Lossless formats such as PNG etc. (or a vector format)

Lossy, lossless, and vector graphics 41

This lecture Information and Data Redundancy Image Quality Compression Coding File formats 42