1 / 22

Data – How (Much of) It Is Stored

Data – How (Much of) It Is Stored. Outline. What Is an Image Really? Methods of Storing Images How to Make a Big File Small Compression Algorithms Conversion Algorithms In theory In practice. What is an image?.

webb
Download Presentation

Data – How (Much of) It Is Stored

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. Data – How (Much of) It Is Stored CS 128/ES 228 - Lecture 7a

  2. Outline • What Is an Image Really? • Methods of Storing Images • How to Make a Big File Small • Compression Algorithms • Conversion Algorithms • In theory • In practice CS 128/ES 228 - Lecture 7a

  3. What is an image? • An image is anything we store on the computer that we think of as a “picture”. It should look “the same” on any display. • Image file formats • GIF, JPEG, TIFF, BMP • NOT shapefiles CS 128/ES 228 - Lecture 7a

  4. File Formats • There are many image file formats • 35 on the first page I hit looking for a list! • Each has advantages and disadvantages CS 128/ES 228 - Lecture 7a

  5. GIF • Developed by Compuserve in 1987 • Particularly good for line drawings (anything with sharp edges) • VERY common on web CS 128/ES 228 - Lecture 7a

  6. JPEG (or JPG) • Product of the Joint Photographers Experimental Group • Good for photos, images with subtle changes • Also popular on the web CS 128/ES 228 - Lecture 7a

  7. GIF vs. JPEG CS 128/ES 228 - Lecture 7a

  8. JPEG 2000 (aka JP2) • “The JP2 and JPX file formats allow for handling of color-space information, metadata, and for interactivity in networked applications as developed in the JPEG Part 9 JPIP protocol.” • Some imagery is now distributed as JP2 files – datum and projection included at no extra charge! CS 128/ES 228 - Lecture 7a

  9. Portable Network Graphics (PNG) • PNG also stands for “PNG’s Not GIF” • Loss-less compression using non-patented algorithm • Supports transparency, but not really animation • ISO standard since 2003 CS 128/ES 228 - Lecture 7a

  10. BMP • Bitmap format – Primarily for Windows (but not exclusively) • NO Compression means LARGE files • Standard Screen Snapshot is BMP CS 128/ES 228 - Lecture 7a

  11. EPS, PICT, TIFF • Encapsulated PostScript (mostly for printing, some display) • PICTure format (Macs only) • Tag Interchange File Format (multi-platform, but less used these days) CS 128/ES 228 - Lecture 7a

  12. Shapefiles and active software • A running program may read from or write to these formats, but generally uses its own memory management while running. • Shapefiles contain shape information and are not in any of these formats – and not truly image files • They are vector layers, after all CS 128/ES 228 - Lecture 7a

  13. Compression Algorithms • Compression algorithms “shrink” files • May do so by mathematical “tricks” or by discarding information CS 128/ES 228 - Lecture 7a

  14. Two KEY Facts about Compression • NO LOSS-LESS compression algorithm can work all the time! • NO LOSSY compression algorithm can regenerate its original data. CS 128/ES 228 - Lecture 7a

  15. 3 7 0 3 1 1 2 3 4 1 6 An LOSS-LESS ExampleRun-length compression • Count and record the length of the data set and then each group of 0’s or 1’s 1110100 1110000 1000000 CS 128/ES 228 - Lecture 7a

  16. 124 029 935 725 304 A LOSSY ExampleTruncation 1242144903 0293570214 9352109521 7259027565 3048282535 1240000000 0290000000 9350000000 7250000000 3040000000 CS 128/ES 228 - Lecture 7a

  17. How much does compression affect image quality? Original (32 MB) Compressed(493 kB) CS 128/ES 228 - Lecture 7a

  18. Converting Vector to Raster • Must compute the equation of the line • Then choose which pixels to highlight • Many algorithms, but differences are technical CS 128/ES 228 - Lecture 7a

  19. X = x0 Y = y0 (x1,y1) Illuminate pixel (x, int(Y)) Y = y0 + 1 Illuminate pixel (x, int(Y)) X = X + 1 /m Y = Y + 1 Illuminate pixel (x, int(Y)) … (x0,y0) Until Y == y1 Typical algorithm CS 128/ES 228 - Lecture 7a

  20. Anti-aliasing Basic idea – Remove the “jaggies” by using color variations CS 128/ES 228 - Lecture 7a

  21. Conversion in practice CS 128/ES 228 - Lecture 7a

  22. Converting Raster to Vector • Basic idea • Find areas with sharp changes – these are your boundaries. • Adjust as topology indicates • Much harder in practice than the other way around • Alternative is hand-digitization CS 128/ES 228 - Lecture 7a

More Related