Lesson Objectives Aims You should know about: 1.3.1:

Slides:



Advertisements
Similar presentations
Data Compression CS 147 Minh Nguyen.
Advertisements

IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture3.
Data Compression Michael J. Watts
CSCI 3 Chapter 1.8 Data Compression. Chapter 1.8 Data Compression  For the purpose of storing or transferring data, it is often helpful to reduce the.
A Data Compression Algorithm: Huffman Compression
Data Representation CS105. Data Representation Types of data: – Numbers – Text – Audio – Images & Graphics – Video.
 Wisegeek.com defines Data Compression as:  “Data compression is a general term for a group of technologies that encode large files in order to shrink.
Spring 2015 Mathematics in Management Science Binary Linear Codes Two Examples.
CSE Lectures 22 – Huffman codes
Lecture 10 Data Compression.
Chapter 2 Source Coding (part 2)
Common file formats  Lesson Objective: Understanding common file formats and their differences.  Learning Outcome:  Describe the type of files which.
Digital Image Formats: An Explanation Guilford County SciVis V
CS 111 – Sept. 10 Quiz Data compression –text –images –sounds Commitment: –Please read rest of chapter 1. –Department picnic next Wednesday.
Image Compression (Chapter 8) CSC 446 Lecturer: Nada ALZaben.
CMSC 100 Storing Data: Huffman Codes and Image Representation Professor Marie desJardins Tuesday, September 18, 2012 Tue 9/18/12 1CMSC Data Compression.
Chapter Ten The Application and Presentation Layers.
COMPRESSION. Compression in General: Why Compress? So Many Bits, So Little Time (Space) CD audio rate: 2 * 2 * 8 * = 1,411,200 bps CD audio storage:
Web Graphics By Chris Harding. Contents  Software  Vector Graphics and Pixel Based  Transparent Images  Compression  GIF vs. JPEG  Animated GIF.
Huffman Code and Data Decomposition Pranav Shah CS157B.
Main Index Contents 11 Main Index Contents Complete Binary Tree Example Complete Binary Tree Example Maximum and Minimum Heaps Example Maximum and Minimum.
Chapter 3 Data Representation. 2 Compressing Files.
Comp 335 File Structures Data Compression. Why Study Data Compression? Conserves storage space Files can be transmitted faster because there are less.
Digital Image Formats: An Explanation Guilford County SciVis V
Information Systems Design and Development Media Types Computing Science.
Computer Sciences Department1. 2 Data Compression and techniques.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
Data Compression: Huffman Coding in Weiss (p.389)
Data Compression Michael J. Watts
2.01 Investigate graphic image design.
Graphic Format Factors
Lesson Objectives Aims You should be able to:
Component 1.9 Security and Data Management
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Data Storage and Compression.
File Compression 3.3.
Chapter 3 Image Files © 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website,
Lesson Objectives Aims You should be able to:
Denary to Binary Numbers & Binary to Denary
Design & Analysis of Algorithm Huffman Coding
CPSC 231 Organizing Files for Performance (D.H.)
Graphic Format Factors
3.3 Fundamentals of data representation
Data Compression.
JPG vs GIF vs PNG What is the difference?
Chapter 3 Image Files © 2017 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Data Compression.
Lossy vs Lossless compression
Data Compression CS 147 Minh Nguyen.
Digital Image Formats: An Explanation
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Web Design and Development
Topic 3: Data Compression.
Graphic Format Factors
Computer Systems – Unit 1
2.01 Investigate graphic image design.
Graphic Format Factors
2.01 Investigate graphic image design.
Graphic Format Factors
Do Now! Convert the following sequence of bits into an image using the protocol we discussed (first 8 bits are lengthxwidth, Then fill in the rows pixel.
Number Systems Instructions, Compression & Truth Tables.
2.01 Investigate graphic image design.
File Compression and Formats
Data Compression.
Chapter 8 – Compression Aims: Outline the objectives of compression.
GCSE COMPUTER SCIENCE Topic 3 - Data 3.9 Data Compression.
Graphic Format Factors
Graphic Format Factors
2.01 Investigate graphic image design.
Graphic Format Factors
Presentation transcript:

Lesson Objectives Aims You should know about: 1.3.1: (a) Lossy vs Lossless compression. (b) Run length encoding and dictionary coding for lossless compression.

Compression Means: Because: Reducing file size Used to be down to storage limitations Now is down to a need to make network transfers quicker

Compression The level of compression is measured as a ratio between 0 and 1 1 = original file size 0 = The best compression tool ever – the delete key.

Compression software and algorithms 7ZIP RAR ZIP TAR TAR.GZ …

Example

How compression is achieved Virtually all data contains “unnecessary” bits By removing redundant information, file size (total number of bits) can be reduced We’re basically chucking bits in the bin, however…

Where can data to lose come from? Consider a video, 30fps Does the background change? What actually moves in that second of video? It may actually be possible to throw away 90% of the data because it’s duplicated!

Lossy Lossy compression will reduce file size but also some data will be lost The original file/quality cannot be restored The file size/quality is a trade off of acceptability JPG, MP3

An example - Bitmap

File Format Differences BMP – 644Kb PNG – 9.05Kb (lossless!) JPG – 30.6KB GIF – 7.71Kb

Side By Side BMP JPG

Lossy Compression Why lose some data? Why not lose data? Can be acceptable – sounds you can’t hear, un-noticable colour loss etc Could provide much smaller file size Why not lose data? When loss would be unacceptable – i.e. text documents or original sound recordings

Lossless Data is compressed but the file can be restored to its original quality Methods: Run length encoding Dictionary coding

Run length encoding There is a lot of repetition in data Such as sequences of pixels in an image that are the same colour Or text which has repeated letters/words.

Run length encoding simply counts them up and replaces them with: A flag symbol The character/pixel The number of times it’s repeated No data is lost, but file size is reduced No point if the encoded data is the same length as the actual data! No good in situations where there is little repetition (think of a checker board design)

Dictionary Encoding Think of a 5000 word essay. Just think of that. Mmm. Essays. You didn’t use 5000 unique words did you? This means there is clearly repetition

A dictionary of unique elements is built from the document Then a series of pointers are created to the correct entry in the dictionary Every time a word is repeated, data is saved.

Huffman Encoding Look at the frequency of letter appearance in the English language:

In ASCII or UTF-8 a minimum of 8 bits is used to encode each character, yet this creates a lot of redundant data Huffman encoding rearranges this and assigns codes to the most common letters E = 0

As a result, these characters have the shortest possible codes – 1 bit! This drastically reduces data use/size

Summary Lossy compression reduces the size of a file but results in data being lost. Lossless compression reduces the file size without losing any data. Run-length encoding replaces a sequence of repeated characters with a flag character, followed by the character itself and the number of times it is repeated. In dictionary coding a dictionary of commonly occurring sequences of characters is created. In the text these sequences are replaced by pointers to the relevant place in the dictionary. The references are shorter than the words they replace, so the file is reduced in size.

Review/Success Criteria