AP CSP: Lossy Compression and File Formats

Slides:



Advertisements
Similar presentations
Data Representation CS280 – 09/13/05. Binary (from a Hacker’s dictionary) A base-2 numbering system with only two digits, 0 and 1, which is perfectly.
Advertisements

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
44212: Web-site Development Optimising Images for Web-pages Ian Perry Room:C49 Extension:7287
FILE TYPES FOR WEB DESIGN 1 HOW SHOULD I SAVE?. GRAPHICS INTERCHANGE FORMAT (GIF) Best used for flat-color, sharp-edged art or text Clip art, logos Compression.
Digital Graphics for Computer Games Pixels Types of Digital Graphics (Raster and Vector) Compression.
GIF vs. JPEG GIF and JPEG (JPG) image formats are different. You should know which to use when. Here are some examples.
Digital Image Formats: An Explanation Guilford County SciVis V
FILE COMPRESSION Lossy vs Lossless. Why compress a file? To save storage space. To speed up data transmission.
OBJECTIVE AND OUTCOMES Objective: To be able to create images in binary format and understand the part metadata plays in recreating images. Outcomes:
Lesson Objectives Aims You should be able to:
AP CSP: Pixelation – B&W/Color Images
AP CSP: Sending Numbers
AP CSP: Creating Functions & Top-Down Design
AP CSP: The Need for Addressing
3.3 Fundamentals of data representation
Exploring Computer Science - Lesson 3-4
Vocabulary byte - The technical term for 8 bits of data.
AP CSP: Sending Binary Messages with the Internet Simulator
Lesson Objectives Aims You should be able to:
Lesson 1-15 AP Computer Science Principles
Vocabulary byte - The technical term for 8 bits of data.
UNIT 2 – LESSON 3 Encoding B&W Images.
Lesson 2-3 AP Computer Science Principles
UNIT 2 – CHAPTER 1 – LESSON 1 DIGITAL INFORMATION.
Exploring Computer Science - Lesson 3-4
Vocabulary byte - The technical term for 8 bits of data.
Vocabulary byte - The technical term for 8 bits of data.
How to Convert Pictures into Numbers
Lesson Objectives Aims You should know about: 1.3.1:
Lossy Compression and File Formats
UNIT 2 – LESSON 2 TEXT COMPRESSION.
Vocabulary byte - The technical term for 8 bits of data.
Vocabulary byte - The technical term for 8 bits of data.
Vocabulary byte - The technical term for 8 bits of data.
Exploring Computer Science - Lesson 3-4
AP CSP: Lossy Compression and File Formats
Vocabulary byte - The technical term for 8 bits of data.
AP CSP: Bytes, File Sizes, and Text Compression
Vocabulary byte - The technical term for 8 bits of data.
File size and image quality
Digital Image Formats: An Explanation
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Topic 3: Data Binary Arithmetic.
Fun gym Cambridge Nationals R001.
Start – Up - Discussion 9/19/17
File Formats V
Data Representation.
Fun gym Cambridge Nationals R001.
WYSIWG – not quite More than displayed information in files
Shaw STEM Lab Orientation
Representing Images 2.6 – Data Representation.
Web Design and Development
Compression, Lossy, Lossless
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Topic 3: Data Compression.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Fundamentals of Data Representation
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
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.
Lesson Objectives By the end of the lesson you will:
Computer Networks Lesson 4.
Essential Question: Why do students need to learn how to take notes?
Real-World File Structures
Binary CSCE 101.
WYSIWG – not quite More than displayed information in files
WYSIWG – not quite More than displayed information in files
1 1. Binary Basics Year 8 Unit 1 Bitmap Graphics.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Presentation transcript:

AP CSP: Lossy Compression and File Formats October 20, 2016

Warm Up: Go to the Lossy Text Compression App Answer these questions: http://bit.ly/1RuiEwT Answer these questions: What is happening in the app? Should this “count” as text compression? Why or why not?

Lossy Text Compression App: The text in the app was reduced by keeping the first letter of every word and throwing away all vowels. Is this really text compression? The amount of text was reduced and people can understand for the most part However, the work of reconstructing was left to human intelligence and intuition.

Lossy vs. Lossless Compression: Data is compressed and can be converted back into its original form. No data loss! Lossy Compression: Compression scheme which useless or less-than-totally necessary information is thrown out in order to reduce the size of the data. The compression app we looked at today compressed the text and for the most part you could probably make out what the text was supposed to say. Not Perfect though. If you saw the word “fd” ” it could be “food”, “feed”, “feud”, or “fad. By reading in context, you may know the correct interpretation but there is no real way to know what the original word. The original word is lost.

File Formats: We’ve looked at file formats and we’ve also seen text compression. Both attempted to render perfectly every piece of information. Both the image file format and text compression were lossless. Lossy compression schemes usually take advantage of the fact that a human is supposed to interpret the data at the other end, and human brains are good at filling the gaps when information is missing

File Type Compression Schemes: You and a partner will do some rapid research and report on some of the most common file formats. Use the web to accomplish this. You and a partner will be assigned one particular file formats and you are going to answer the questions relating to that format on the worksheet I hand out. After about 10 to 15 minutes we are going to share what we found out with the rest of the class. Each student will fill out the first two columns for the file formats they didn’t work on while listening to other students share what they found.

Wrap-Up: There was a question at the bottom of the worksheet that asked if you had ever heard of any other file type that you were curious about. What were those? All of these are specialized file formats in which some person or group decided how to organize (and in some cases, compress) the bits that make up the file type. There is nothing magical about them.

Wrap-Up Continued: The file extension you often see on a file (for example: myPhoto.jpg) is really just an indicator to the computer of how the underlying bits are organized, so the computer can interpret them. If you change the name of the file to myPhoto.gif, which does not magically change the underlying bits; all you’ve done is confuse the computer. It won’t be able to open the file because it will attempt to interpret the file as a GIF when really the bits are in JPG format.

Changing File Extensions: Different file formats have their own way of representing data in binary. The extension at the end of a file let the computer know how to interpret the bits within the data. Different file types interpret bits in data differently. The first 8 bits in a PDF may describe how many pages the document is while the first 8 bits in a BMP file represent the width of an image. If you were to change a PDF file’s extension to BMP the computer would interpret the bits in the PDF file as if they were BMP (image) file. Textbook.pdf - Textbook.bmp When now trying to open the file, your computer will try to open up the original PDF file using the protocol for BMP It’ll interpret the first 8 bits of the file as the width of an image when the first 8 bits of a PDF file aren’t used to describe width or even an image. The results would be messy.