Ch3 Image Compression
John. F. Kennedy (Former President of USA) Who is this man?
Ask not what your country can do for you -- ask what you can do for your country. John F. Kennedy Inaugural Address January 20, 1961 Watch the video at 4:00mins
Is it possible to compress this sentence?
Ask not what your country can do for you - - ask what you can do for your country. 63 letters + 16 spaces = 79 units How to compress it. Keep the data but shorten the length How to compress it. Keep the data but shorten the length
We know that… "ask" appears two times "what" appears two times "your" appears two times "country" appears two times "can" appears two times "do" appears two times "for" appears two times "you" appears two times
There we can represent those frequency words by numbers.. 1. ask 2. what 3. your 4. country 5. can 6. do 7. for 8. you
Ask not what your country can do for you -- ask what you can do for your country. will become … 1 not units
Activity Use Winzip to compress two files, “text1.doc” and “text2.doc”, with similar size. Which one has higher compression rate? Why?