Presentation is loading. Please wait.

Presentation is loading. Please wait.

School of Computer Science & Information Technology G6DPMM - Lecture 4 Graphics & Still Image Representation.

Similar presentations


Presentation on theme: "School of Computer Science & Information Technology G6DPMM - Lecture 4 Graphics & Still Image Representation."— Presentation transcript:

1 School of Computer Science & Information Technology G6DPMM - Lecture 4 Graphics & Still Image Representation

2 Analogue vs Digital Analogue information Analogue information Continuously variable signal Continuously variable signal Physical phenomena Physical phenomena Sound/light/temperature/position/pressure Sound/light/temperature/position/pressure Waveform Waveform Electromagnetic (e.g. light) Electromagnetic (e.g. light) Pressure (e.g. sound) Pressure (e.g. sound) Information conveyed by amplitude and frequency Information conveyed by amplitude and frequency Digital information Digital information Discrete values Discrete values Smoke signals / Morse code / Binary electronic Smoke signals / Morse code / Binary electronic Sampling of analogue information Sampling of analogue information Analogue to Digital Conversion (A2D) is sampling Analogue to Digital Conversion (A2D) is sampling

3 Analogue Media We see an analogue world We see an analogue world Analogue image storage technologies: Analogue image storage technologies: Paint / Chemical film / Photocopier / Video Paint / Chemical film / Photocopier / Video Analogue systems all have “noise” Analogue systems all have “noise” Random variations Random variations Hence sequential copies deteriorate Hence sequential copies deteriorate Analogue media is hard to manipulate by computer Analogue media is hard to manipulate by computer Generally involves computer-controlled devices Generally involves computer-controlled devices

4 Digital Media Digital media is very much easier to manipulate by software Digital media is very much easier to manipulate by software Digitisation is never perfect Digitisation is never perfect A2D Sampling is an approximation A2D Sampling is an approximation Quality is dependent upon the amount of sampling done Quality is dependent upon the amount of sampling done High quality digital media tends to be large High quality digital media tends to be large Lots of bits needed to store samples! Lots of bits needed to store samples! Compression is a major issue Compression is a major issue

5 Types of Graphics Computer graphics fall into two categories: Computer graphics fall into two categories: Vector Graphics Vector Graphics Used for computer generated images, line drawings, cartoons etc. Used for computer generated images, line drawings, cartoons etc. Bitmap (Raster) Graphics Bitmap (Raster) Graphics Used for photographs Used for photographs

6 Vector Graphics Mathematical definitions of lines Mathematical definitions of lines Scaleable Scaleable Not suitable for photographs Not suitable for photographs Examples Examples Postcript Postcript CGM CGM WMF WMF HPGL HPGL DXF DXF Edited using “drawing” software Edited using “drawing” software

7 Bitmap Graphics Matrix of ‘pixels’ Matrix of ‘pixels’ Difficult to re-size Difficult to re-size Suitable for photographs Suitable for photographs Examples Examples BMP (DIB) BMP (DIB) GIF GIF PCX PCX TIFF TIFF TARGA TARGA JPEG JPEG PNG PNG Edited using painting software (eg Photoshop) Edited using painting software (eg Photoshop)

8 Bitmap Graphics

9 Colour Depth

10

11 Colourmapping 8-bit colour depth - pixels contain a reference to a “palette” (ie 24-bit values) 8-bit colour depth - pixels contain a reference to a “palette” (ie 24-bit values) High quality 8-bit (256 colour) images High quality 8-bit (256 colour) images 16-bit colourmapping (32,768 colours) 16-bit colourmapping (32,768 colours) Reasons for colourmapping Reasons for colourmapping Hardware may require it Hardware may require it Some software manipulation requires it Some software manipulation requires it Some compression techniques require it Some compression techniques require it Optimised vs System palette Optimised vs System palette Display Mode and Palette Flashing Display Mode and Palette Flashing

12 Vector / Bitmap Conversion Vectors  Bitmap Vectors  Bitmap Easy Easy Perfect representation - scaling issue Perfect representation - scaling issue Bitmap  Vector Bitmap  Vector Much harder - autotrace Much harder - autotrace Poor quality Poor quality Highly lossy Highly lossy

13 The Need for Compression Graphics tend to be big! Graphics tend to be big! Consider the following: Consider the following: 1024x768 24-bit image 1024x768 24-bit image 1024 x 768 = 786,432 pixels 1024 x 768 = 786,432 pixels 786,432 x 24 bits = 18,874,368 (c. 18.4 Mb) 786,432 x 24 bits = 18,874,368 (c. 18.4 Mb) Approximately 40 images per 750 Mb CD-ROM! Approximately 40 images per 750 Mb CD-ROM! Data compression is essential Data compression is essential

14 Image Compression Lossless Compression Lossless Compression Decompressed image is a perfect copy of the original Decompressed image is a perfect copy of the original Example File Format: GIF Example File Format: GIF Lossy Compression Lossy Compression Decompressed image is an imperfect approximation of the original Decompressed image is an imperfect approximation of the original Example File Format: JPEG Example File Format: JPEG

15 Lossless Algorithms Run Length Encoding Run Length Encoding Sequences of “runs” of repeated data is replaced by a single data item, and the length of the run. Sequences of “runs” of repeated data is replaced by a single data item, and the length of the run. Used by TIFF, DIB/BMP Used by TIFF, DIB/BMP LZ77 LZ77 Lempel-Ziv substitutional compression (1977) Lempel-Ziv substitutional compression (1977) Keeps track of a “window” of data – if repetition is seen it replaces this with a reference. Keeps track of a “window” of data – if repetition is seen it replaces this with a reference. Many applications – including Huffman (LZH) and Zip Many applications – including Huffman (LZH) and Zip LZW (Lempel-Ziv-Welch) LZW (Lempel-Ziv-Welch) Derived from LZ77 Derived from LZ77 Developed (and patented) by Unisys – licensed for Compuserve Developed (and patented) by Unisys – licensed for Compuserve Used by GIF Used by GIF Deflate Deflate Derived from LZ77 Derived from LZ77 Used by PNG Used by PNG

16 Lossy Algorithms Common algorithms all operate on the waveform Common algorithms all operate on the waveform Fourier Transform Fourier Transform A technique for expressing a waveform as a weighted series of sines and cosines A technique for expressing a waveform as a weighted series of sines and cosines DCT (Discrete Cosine Transform) DCT (Discrete Cosine Transform) A type of Fourier transform A type of Fourier transform Waveform is expressed as a weighted sum of cosines Waveform is expressed as a weighted sum of cosines Used by JPEG Used by JPEG Wavelets Wavelets An alternative to Fourier transform An alternative to Fourier transform Signals converted into a series of rough-edged wavelets Signals converted into a series of rough-edged wavelets Mostly used for specialised purposes (e.g. for fingerprints) Mostly used for specialised purposes (e.g. for fingerprints) Fractal Compression Fractal Compression Fractal theory Fractal theory Not (currently) widely used Not (currently) widely used

17 JPEG Compression Original Image - 285 K

18 JPEG Compression 50% Compression - 15 K

19 JPEG Compression 70% Compression - 10.8 K

20 JPEG Compression 90% Compression - 6.9 K

21 JPEG Compression 95% Compression - 5.3 K

22 JPEG Compression 99% Compression - 2.6 K

23 Image File Formats Vendor Defined Formats Vendor Defined Formats OS Vendors (eg Microsoft / Apple) OS Vendors (eg Microsoft / Apple) Application Vendors (eg Adobe) Application Vendors (eg Adobe) May be open, (ie published specifications) or closed (protected by IPR) May be open, (ie published specifications) or closed (protected by IPR) Vendor Neutral Formats Vendor Neutral Formats Usually defined by standards organisations Usually defined by standards organisations

24 Apple Macintosh Formats PICT PICT Very versatile Very versatile May contain bitmap and vector graphics, and metadata. May contain bitmap and vector graphics, and metadata. May be compressed or uncompressed using various algorithms. May be compressed or uncompressed using various algorithms. Can be ported to other platforms, but some features usually lost. Can be ported to other platforms, but some features usually lost. Now rarely used – even on Macintosh! Now rarely used – even on Macintosh!

25 Windows Formats Microsoft DIB (Device Independent Bitmap) Microsoft DIB (Device Independent Bitmap).BMP.DIB.RLE.BMP.DIB.RLE 1, 8 or 24 bit bitmap - optional RLE compression 1, 8 or 24 bit bitmap - optional RLE compression Microsoft PAL (Palette) Microsoft PAL (Palette) Palette for 8 bit images Palette for 8 bit images Microsoft RIFF (Resource Interchange File Format) Microsoft RIFF (Resource Interchange File Format) Embedded DIB Embedded DIB Other media types Other media types Windows Metafiles (WMF) Windows Metafiles (WMF) Usually used for vectors, but can contain almost anything! Usually used for vectors, but can contain almost anything!

26 Adobe Formats Photoshop PDF Photoshop PDF Bitmap format (mostly) Bitmap format (mostly) Uncompressed Uncompressed Supports various colour models Supports various colour models Supports all features of Photoshop (eg layers, channels etc). Supports all features of Photoshop (eg layers, channels etc). Version issues Version issues Postcript Postcript Page description language for printers Page description language for printers Encapsulated postcript (EPF) Encapsulated postcript (EPF) Primarily used for Vectors, but can contain embedded bitmaps. Primarily used for Vectors, but can contain embedded bitmaps.

27 Truevision Targa Truevision - graphics hardware & software company Truevision - graphics hardware & software company Targa (TGA) Targa (TGA) Bitmap (1 to 32 bits), with optional RLE Bitmap (1 to 32 bits), with optional RLE Multiple images (eg different resolutions) Multiple images (eg different resolutions) Metadata Metadata Advanced features (eg alpha channels and gamma values) Advanced features (eg alpha channels and gamma values) Developer definable data Developer definable data Very widely used for storage of high quality (24 or 32 bit) images. Very widely used for storage of high quality (24 or 32 bit) images.

28 Aldus/Adobe TIFF TIFF (.TIF) Tag Image File Format TIFF (.TIF) Tag Image File Format Formerly Aldus - now maintained by Adobe Formerly Aldus - now maintained by Adobe 24 bit bitmap format 24 bit bitmap format Supports a wide range of compression algorithms (including RLE, LZW, JPEG and many others) Supports a wide range of compression algorithms (including RLE, LZW, JPEG and many others) Extensive metadata capability Extensive metadata capability

29 CompuServe GIF 8 bit LZW compressed bitmap Supports transparency Supports multiple images & animation Widely used on WWW Licence problems CompuServe patent Unisys policy

30 PNG Portable Network Graphics Designed to replace GIF Supports greyscale, colourmapped or truecolour images (up to 48 bit!) Supports alpha channels and gamma correction Lossless CRC-32 compression No multiple image support No patent problems!

31 JPEG Joint Picture Expert Group Joint Picture Expert Group Both an algorithm and a file format! Both an algorithm and a file format! Lossy Truecolour compression (DCT) Lossy Truecolour compression (DCT)


Download ppt "School of Computer Science & Information Technology G6DPMM - Lecture 4 Graphics & Still Image Representation."

Similar presentations


Ads by Google