FIT3084: Images


In the previous lecture:

In this lecture:


lynx browser Mosaic Browser

The Lynx web browser was text only and used the arrow keys to navigate between links.

The Mosaic web browser allowed for inline images and mouse clicks to select hyperlinks. It really changed the way people thought about the WWW!


Images are now used as...

Special considerations...

(File) Size does matter (and smaller is better!)
Another web spider

XHTML image tag WIDTH and HEIGHT specification accelerates browser page layout and can be used to scale an image up or down uniformly,

or non-uniformly!

Another web spider

Scaling an image in this way does not make it any faster (or slower) to download. File size remains unchanged, only the screen space the image occupies is altered.

The image may look pixellated if scaled up too large.


Accessibility


Use images wisely and carefully so that where possible, their functionality is duplicated using other means.

Examples of legal cases concerning accessibility issues: airline companies, Sydney Olympics organizers.


What is a digital image?

Bitmap images* - the historical WWW standard, supported by all current web browsers

  • Grid (sometimes called a raster grid) of coloured points called pixels (picture elements)

  • Grid dimensions are the image's width & height

  • A bitmap image file is a means of storing information to retrieve the value of every pixel of the image

  • Large file sizes


* Sometimes black and white raster images are referred to as "bitmaps" since they require one bit per pixel to specify.

Web Spider Pixels
Enlarged (pixellated) bitmap

Object-based / Vector images - supported directly (in the form of SVG) by browsers other than Microsoft Internet Explorer

  • SVG : Scalable Vector Graphics (based on XML)

  • Collection of geometric shapes: lines; ellipses; rectangles; polygons. These are usually edited with interactive software by moving control points, at line mid / end points or shape vertices.

  • Enable redrawing image at any resolution.

  • Result in very small file sizes.

Vector graphics sample
Bitmap of a vector image
(control points marked)


A sample SVG document from w3schools...

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
</svg>

...that looks like this (only viewable by SVG enabled browsers or a plugin).

 

 

In your own time:

Use your browser controls to zoom in closely on the SVG image (above).

Do the same with the bitmap version of the circle (right).

What is the difference?

SVG circle (bitmap version)

Lossy and Lossless Bitmap Image Compression

 

It is simple (but space hungry) to write every pixel value into a file as an R, G, B triple (refer to the lecture on colour for details)



web spider

Or, each value stored in the image file is an index into a colour table or palette holding the colours used in the image.

For this image, with this palette,

255 = Black
044 = Red
000 = White

web spider colour palette

Compression schemes

Lossy schemes

Lossless schemes

Skull image - captured using a camera.

skull lossless compression (GIF)
GIF
38 kBytes (lossless*)

skull lossy compression (50% JPEG)
50% JPEG
4 kBytes (lossy)

skull lossless compression (25% JPEG)
25% JPEG
2.5 kBytes (lossy)



Spider image - synthesized digitally.

spider lossless compression (GIF)
GIF
15 kBytes (lossless*)

spider lossy compression (50% JPEG)
50% JPEG
3 kBytes (lossy)

spider lossly compression (25% JPEG)
25% JPEG
2 kBytes (lossy)

 

Text image - synthesized digitally.


GIF (lossless)

JPEG (lossy)
Under very high compression to accentuate the edge artefacts

Bitmap Image Formats With Web Browser Support

Image Format Attributes

 

GIF87a

GIF89a

JPEG

Progressive
JPEG

PNG

Lossless Compression

X*

X*

-

-

X

Transparent Backgrounds

-

X

-

-

X

Interlacing

X

X

-

X

X

Animation

-

X

-

-

-

Maximum colours

256

256

16.7 million

16.7 million

16.7 million

Transparent Image Backgrounds

  • User-selected colour rendered transparently

  • Browser background shows through

  • Hides rectangular image border

Image Interlacing

GIF Animation

  • Sequence of image frames stored within GIF89a file

  • Frames displayed in sequence by browser

Thumbnail Images

  • Scaled down version of larger image

  • May be hyperlinked to larger image

  • Loads (much) faster than larger image

  • Consume less screen space than larger image
  • Provides preview of larger image

  • Useful in gallery setting

  • Useful as buttons & icons

  • Example: above

* Footnote: GIF is lossless only if the source image has 256 colours or less!


Image maps


Backgrounds

Uniform background colours and appropriate text / link colours may be specified as attributes of the XHTML BODY tag:

Or a background image specified: BACKGROUND="imageName.GIForJPEG"

Use background images with uniform and subdued colours

Bad background

and contrasting text!

Use small, seemlessly tiled images to save background download time. (Instead of single huge background images)



This lecture's key point(s):


Courseware | Lecture notes

©Copyright Alan Dorin 2009