1 / 28

Image File Formats A Review of Common Image Storage Formats

Travis Roe Topics of Computer Science . Image File Formats A Review of Common Image Storage Formats. Objectives. Image File Formats Compression Lossless Lossy Comparisons Applications Resources/References Questions. Image File Formats. Uncompressed

jennis
Download Presentation

Image File Formats A Review of Common Image Storage Formats

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Travis Roe Topics of Computer Science Image File FormatsA Review of Common Image Storage Formats

  2. Objectives • Image File Formats • Compression • Lossless • Lossy • Comparisons • Applications • Resources/References • Questions

  3. Image File Formats • Uncompressed • BMP (generally, although not always)‏ • PPM (text, sometimes) • Compressed - Lossless • GIF • PNG • Compressed - Lossy • JPEG

  4. Lossy Compression • Lossless (xkcd 331)

  5. CompressionLossless • Reconstruct images with the same bit patterns as before • Often compress artificial images, or images with sharp lines very well. • Useful for storing images with sections of continuous color (or lack of color – transparency)‏

  6. PNG 1-48 bit color depth(16 bit grayscale) Up to 8-bit color pallete Full alpha channel (256 levels of transparency) Single-image (MNG handles multiple) Free!(was designed partially to replace GIF)‏ CompressionLossless - GIF and PNG comparison GIF • 1-8 bit color depth • Up to 8-bit color pallete • Single color transparency • Multiple-images per file • Patented

  7. CompressionLossless – A Terror to Compression • Every single color possible in 24 bit color.http://www.libpng.org/pub/png/img_png/16million.png • How do we handle that!? Huffman encoding cries! • GIFs do not have enough color depth to represent them (they weren't designed for it, anyway) • PNGs handle this: • Uncompressed 48MB • Compressed (w/o Filters) 36MB • Filters 113KB (PNG book explained it could be even smaller!)‏

  8. CompressionLossless – PNG • Uses filters (a different filter can be used for each line) to simplify compression • None (bytes are unchanged)‏ • Subtract (the difference of one pixel to the one before it)‏ • Up (the difference of one pixel to the one above it)‏ • Average (the difference between one pixel and the ones to the left and above it)‏ • Paeth (based on Paeth predictor) (adapted from Roelofs, Table 9-1, p148)‏

  9. CompressionLossy • Sacrifices perfect storage for lower file sizes, yet still acceptable images. • Good for photographs • Not designed for sharp edges and text. • Not designed as an intermediate format for post-processing

  10. When you repeatedly save-and-load-and-save-and-load a lossy-ly compressed image, more of the image's data disappears. CompressionLossy – Maluse

  11. CompressionLossy - Maluse - Original

  12. CompressionLossy - Maluse - JPEG save 1 (10%)‏

  13. CompressionLossy - Maluse - JPEG save 10 (10%)‏

  14. CompressionLossy - Maluse – Differences between 1 and 10

  15. CompressionLossy - Maluse - Differences 1-10 exaggerated

  16. As stated earlier, another thing that lossy image file formats are not designed for is text and sharp lines. CompressionLossy – Maluse 2

  17. CompressionLossy – Maluse 2 (examples)‏ • Compression artifacts can do great damage to text, especially at higher compression levels (lower quality images)(example is at 40% compression)‏

  18. Comparisons • Real-World Examples • Comic Book with Text • Dog • 2 “Drawings”

  19. ComparisonsComic Book with Text • Original file (PNG): 21.2kB • JPEG @ 25%(approx same size, quality still acceptably good) • GIF (4 bit) 13.7kB • PNG (my version, 4 bit): 12.5kB

  20. ComparisonsDog (512 x 768)‏ • JPEG (10%): 134kB • PNG (24bit): 659kB • PNG (8 bit pallete): 188kB

  21. ComparisonsDog (JPEG vs Palleted PNG)‏ JPEG : 134kB PNG: 188kB

  22. ComparisonsDrawing 1 • PNG: 159kB • JPEG (5%)103kB(there were noticable compression artifacts when zoomed to 300%) • PNG (pallete, dithered): 106kB

  23. ComparisonsDrawing 1 (24bit PNG vs 8-bit PNG 24 bit PNG 8-bit PNG (pallete)‏

  24. ComparisonsDrawing 2 • PNG: 33.8kB • JPEG (10%): 36.5kB • JPEG (5%): 51.7kB • PNG (pallete, dithered): 24.2kB (no noticable difference between 24bit PNG and 8-bit palleted one)‏

  25. Applications • So what does this have to do with CS? • Many programs use images. Finding out the most appropriate format for the job and then using it can save space. That is especially useful when programs are restricted in space (like a cell phone or a game that's near the edge of the CD/DVD limit) • Web developers want to keep their bandwidth to a minimum. Reducing the amount of space needed to store the same image helps.

  26. Resources/ReferencesResources Used • Image Editing Software • Corel Paint Shop Pro Photo XI (version 11.20)‏ • The GIMP 2.4.1 (Windows Version)‏ • Picasa2 (primarily for browsing) • Camera Used • Canon Digital Rebel (EOS 300D)‏

  27. Resources/ReferencesReferences • 16million.jpg http://www.libpng.org/pub/png/img_png/16million.png • Roelofs, Greg. PNG: The Definitive Guide. O'Reilly & Associates. 1999. (also available online at: http://www.oreilly.com/catalog/pngdefg/ )‏ • Wolfgang, Ray. “JPEG Tutorial”. Perdue University. http://cobweb.ecn.purdue.edu/~ace/jpeg-tut/jpegtut1.html • XKCD episode 331: http://xkcd.com/331/

  28. Questions • When saving an image like a photograph, what's the most appropriate kind of file format to use? • If an image has a range of transparency, what file format should be used to render it?

More Related