Presentation is loading. Please wait.

Presentation is loading. Please wait.

AP CSP: Lossy Compression and File Formats

Similar presentations


Presentation on theme: "AP CSP: Lossy Compression and File Formats"— Presentation transcript:

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

2 Warm Up: Go to the Lossy Text Compression App Answer these questions:
Answer these questions: What is happening in the app? Should this “count” as text compression? Why or why not?

3 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.

4 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.

5 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

6 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.

7 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.

8 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.

9 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.


Download ppt "AP CSP: Lossy Compression and File Formats"

Similar presentations


Ads by Google