Still Images
raster graphics
file formats
Raster Graphics: Bitmaps
• bit - binary
– on or off
– 1 or 0
• map
– two-dimensional matrix
• fig 6-1 (Vaughan 2004) below
– memory (bits) needed to display various levels of
colour
– 2 to 16,722,216 possible colours
Raster Graphics: Bitmaps
• sometimes known as pixel maps because
– “bitmap” … two-colour or
one-colour + transparency image
• fixed number (perhaps thousand of millions)
of dots (pixels)
– each pixel a single colour
– typical size one pixel
•
• we perceive an image rather than separate dots
– our eyes blend pixels together
• raster graphics superior to vector
–
• detail so great vectors cannot effectively represent image
Raster Graphics
• editing
– modify pixels (not lines or curves)
• resolution dependent
– enlarge : redistribute the pixels
• affects quality
– if output device has lower resolution than image
• may degrade image quality
• uses
–
–
Raster Graphics - Map
• represents rows and columns of dots
• contain value (colour) of each dot
– (background colour if not filled in)
• density of the dots – resolution
– determines how sharply image is represented
– expressed in dpi or number of rows and columns
(eg.640 * 480)
• to display on monitor
– translate map into pixels
• to print on printer
– translate map into ink dots
• optical scanners, fax machines
– transform text or pictures into maps
Raster Graphics Files
• always saved as raster graphics files
– scanned photos
• disadvantages
– takes up lots of room
– may suffer from the jaggies
– enlargements – unnatural blocky appearance
• applications creating raster based image files
– hundreds
– Photoshop dominates
– Macromedia Fireworks (also handles vector)
Raster Graphics: Bit Depth
bit depth binary combinations colours
1-bit 0 1 2
2-bit
4-bit 0000 0001 0010 0011
0100 0101 0110 0111
1000 1001 1010 1011
1100 1101 1110 1111
8-bit 256
RGB colour: 24 bits … 8 bit R, 8 bit G, 8 bit B = 256 *256*256 = 16,722,216
Graphics File Formats
Mac PC R V 1 2 4 8 16 24 32 C
GIF
JPEG
PNG
TIFF
PICT
PSD
TARGA
R raster V vector C compression
numbers: bit depth - applicable only to raster graphics files
Graphics File Formats
Mac PC R V 1 2 4 8 16 24 32 C
PCX
BMP
Metafile
CGM
AutoCad
DXF
GL/2
EPS
R raster V vector C compression
numbers: bit depth - applicable only to raster graphics files
GIF
• pronunciation?
• Graphics Interchange Format
– UNISYS Corporation and Compuserve
– to transmit graphical images over phone lines via
modems
– hold patent – so new standard (PNG) developed
• covers only compression, not decompression
• so UNIX gunzip can decompress LZW -compressed files
• LZW lossless compression
– Lempel-Ziv-Welch
• limited to 8 bit (256) colour images
– has access to > 16 million colours
– each image limited to 256 colour palette
• original specification still images only
– animated GIF now supported
GIF
Features making GIF well-suited for Web
• file compression
• transparency – not true alpha-transparency
• interlacing
• storage multiple images in single file
– allows for a primitive form of animation
• GIFs still very popular (despite patent)
– well-supported
• best suited for
– images with large areas of flat and limited colour
– drawings: logos, text, line art
GIF vs JPEG
GIF vs JPEG
GIF
Limitations useful
• rule:
do not use GIF to display photographs online
• BUT limitations used for creating special effects
–
Turn off dithering when you use GIF
Because of the way GIF compression works
– images with horizontal stripes have smaller file size
than one with vertical stripes
JPEG
• Joint Photographic Experts Group
• most important current standard for image
compression
• created by working group of ISO
– International Organisation for Standardisation
• lossy compression
– takes advantage of limitations in human vision system
to achieve high rates of compression
• cannot see extremely fine detail
(more pronounced for colour)
– as compression increases information removed
– quality level should always be 40 or above
• as high as possible (trade off with download times)
JPEG
• JFIF is a new TIFF subformat
– embeds a JPEG image into a TIFF file
– not popular because
• more complex without offering more capability
• can be saved as progressive jpegs
– image downloads in multiple passes
• standard resolution for images for web
– 72 dpi
– scan them in at a higher resolution
• used for images with
–
• supports millions of colours
– no transparency
PNG
PNG – Portable Network Graphics
• pronounced “ping”
• PNG-8 form
– works like a patent-free replacement for GIF
• supports indexed colour
• PNG-24 form
– supports greyscale and millions of colours
• up to 48 bit
– challenges JPEG
• supports alpha-transparency
– true alpha-transparency (unlike GIF)
– so excellent alternative to JPEG
PNG
PNG – Portable Network Graphics
• high compression rate
– unsurpassed among “lossless” formats
• W3C recommendation - BUT
• poor support from some browser manufacturers
– IE still does not support PNGs alpha transparency
• shows up solid white
– promised for IE 7
• extensible file format
– Fireworks PNG stores proprietary data
• think of it as a PSD (Photoshop)
Other File Formats
TIFF – Tagged Image File Format
• versatile, works on both Mac and PC
• supports almost any picture depth
• disadvantages
– many version and types of compression – no current system can
decode them all
– never sure how it will behave
• use no compression or LZW lossless
– not good for Web
• large file sizes and lack of browser support
PICT - picture
• meta format
– can be used for both vector and raster images
• developed by Apple computers 1984
– encoded in QuickDraw commands
• Apple replacing it with PDF
– Adobe Portable Document Format – hybrid R + V
Other File Formats
PSD – PhotoShop Data - proprietary
• native Photoshop file format created by Adobe
• primarily raster but also provides support for
– layering and multiple alpha channels
– vector type and multiple paths
• converting PSD to another raster format
– flattens it (disables features)
TARGA (TGA)
• most common in the video industry
• also used by high-end paint and ray-tracing programs
• has many variations
• supports several types of compression.
Other File Formats
PCX
• a straightforward raster file originally available only on the PC
• PCX is migrating to the Mac as programs become cross-platform
• suppported by
– Adobe Photoshop
– QuarkXPress for the Mac
BMP
• available in almost all Windows-based graphics applications
• primarily used in Windows application development
Windows Metafile (WMF)
• a list of calls to the Microsoft Windows graphics drawing library
• small and flexible
• difficult to display properly without program used to create them
Computer Graphics Metafile (CGM)
• very flexible vector format
• can also save raster information
• so flexible that very few applications can use all the types available
Other File Formats
AutoCAD DXF
• a standard for exchanging CAD drawings
• vector information is ASCII encoded
– so files can become very large
Hewlett-Packard GL/2
• HP plotter language often used as an exchange format for graphics
Encapsulated PostScript (EPS)
• vector file
• relies on the PostScript page description language to draw image
• can also contain raster information
(even though it's not a raster format)
• generally contains a raster graphic as a screen preview
• Mac EPS files use a PICT and PC EPS files use a TIFF graphic
• only format to support transparent white in bitmap mode
Colour Depths and Compression Formats
1. 24 bits
2. dithered to 8 bits
• adaptive palette (best 256 colours to
represent image)
3. dithered to 8 bits
• Macintosh system palette (optimised
standard mix of 256 colours)
4. dithered to 4 bits
• any 16 colours
5. dithered to 8 bit grey-scale
• 256 shades of grey
6. dithered to 4 bit grey-scale
– 16 shades of grey
7. dithered to 1 bit
– 2 colours (black and white here)
fig 6-2 Vaughan (2004)
Dithering
http://en.wikipedia.org/wiki/Dithering
References
Vaughan, T. (2004) Multimedia: Making It Work 6th edition
New York: McGraw Hill Technology Education
Ze-Nian Li and Drew, Mark S. (2004) Fundamentals of
Multimedia Upper Saddle River, NJ: Pearson Prentice
Hall