Recent Changes - Search:

Web Design

This website demonstrates using wikis as teaching and learning tool.

The course instructor is happy to share the teaching materials here with those who find it readable.

Web Graphics

A Web Design Lecture by Steven Choy

Overview: Functions of web gaphics - Choosing image for your site - Ways to get images for your site - Using thumbnails - Using illustrations and icons - Web graphics formats - Optimizing your website images - Writing useful ALT text - Background images


Functions of web graphics

  • Contextual images (as part of content):
images are used as part of website content. It is coded in HTML
     <img src="example.jpg" alt="A brief description of the image"
      width="300" height="300" />
Class discussion: Why we need to specify the width and height of the image? What is the advantage of doing so?
  • Functional images:
images that are used to provide important functions, such as navigation, image link to important web page, or icons.
Functtional images can provide valuable visual clues to the meaning of links within a website.
  • Decorative images: images are used as part of layout and interface design. It is coded in CSS
     #content h3 { background: url(http://www.example.com/sample.gif) no-repeat;}

Choosing images for your site

  • What is the point of having images on your site?
Q1) Do your images need to convey any information?
Q2) Are they just for decorations?
Q3) Do you want them to support the message of the words?
Q4) What impression are you trying to create?

Ways to get images for your site

  • Scanning photos from printed materials
  • Digital photos from digital camera
  • Hire a photographer
  • Use stock photography
  • Free photos from the Web
Examples of sources that provide free photos:
http://sxc.hu/ - Stock.XCHNG, the leading FREE stock photo site!
http://www.stockvault.net/ - Stockvault.net | Free Stock Photos and Free Images
http://www.dreamstime.com/ - Stock Photography: Download Free Stock Photos & Royalty Free Images

Using thumbnails

  • The larger a photo is, the longer it takes to load in your web browser.
  • Thumbnail images are small versions of larger images, which are quick to download.
  • They allow visitors to look through a series of photos quickly, before deciding which to view in more detail.
  • How to make thumbnails
    • Use your graphics software
    • Use a specialized program to make thumbnails of a large bacth of images

Using illustrations and icons

  • You can draw illustration by hand and then scan them.
  • You can use a software tool to create illustrations from scratch (e.g. Adobe Illustrator).
  • You can find an illustrator to create the artwork for you.
  • You can buy illustration from a stock library.
  • Icons can provide valuable visual clues to the meaning of text and links within a website.
  • You can create your icons set from scratch or buy from other sources.
  • There are many free icon sets in the world for web developers.

Graphic file formats

JPEG

  • JPEG stands for Joint Photographic Experts Group.
  • JPEGs are a lossy format; not all of the information in the original image is preserved.
Professional photographers and programmers worked out this solution (early '90's) to incorporate millions of colors in an image with a range of compressed file sizes depending on how much quality you wish to retain -- the smaller the file, the lower the quality.
  • Good for: Photographs, Game screenshots, Movie stills
  • Bad for: Line art and text, Comic strips, Anywhere where fine lines or sharp color contrast is needed, Windows application screenshots

PNG

  • PNG stands for Portable Network Graphics
  • PNG is lossless; it won't distort or alter the original image.
Developed in the late '90's to offer improvements on both GIF and JPEG formats, the 8 bit PNG offers a maximum of 256 colors, but with a wider range of transparency options. 24 bit PNG, offers millions of colors, like JPEG, but cannot reduce file size as much as JPEG because this format uses "lossless" compression methods.
  • PNG is the image format to use for line art, text, screenshots of Windows, general web graphics and "comic strip" style art.
  • Good for:
    Text, line art, comic-style drawings, general web graphics
    Windows application screenshots
    When accurate reproduction (lossless) is required (24 bit PNG)
    When alpha channel (transparency) support is required
    As a general replacement for anything that is a non-animated GIF
  • Bad for:
    Photos, in-game screenshots (only when quality is not important and you're looking for small files)
    Disappointing browser support for 32 bit PNGs from Microsoft and others

GIF

  • GIF stands for Graphic Interchange Format.
    Originally developed by CompuServe in the '80's, this format offers a maximum of 256 colors, is still used for simple animations, and is lossless -- does not introduce pixel noise into images. Web art books recommend this format to keep clean edges around illustrations & text -- though PNG offers the same advantage.
  • GIF is obsolete and should not be used.
  • Where you have a GIF file, a PNG would do just the same and be noticably smaller due to superior compression algorithms.
  • Good for: Where animations are required, Widespread browser support
  • Bad for: Large file sizes compared to PNG for the same quality, Often limited to 256 colors (8 bit)

Transparency

  • the GIF and PNG formats support transparency.
  • This allows a graphic designer to designate the background of the image transparent.

Conclusions

  • GIF, or PNG-8 work best to retain crisp detail in simple illustrations (less than 256 colors), and for web graphics containing text (so the text edges remain sharp)
  • JPEG is still great for photographs displaying millions of colors at a very small file size
  • GIF is still the format of choice for simple animations (PNGs are not yet compatible for animations), though JPEGS are used in some FLASH animation work.
  • PNG-24, though larger in file size, is a good choice if you don't wish to lose any quality (reduce details, and introduce pixels and noise not in the original photo) in photographs
(32 colors GIF 11k vs 17 million colors JPG 22k)

References:


Optimizing your website images


Writing useful alternative text for images

  • Alternative text provides a textual alternative to non-text content in web pages.
  • The principles can be applied to images, media, applets, or other non-text web content.
  • Functions of alternative text
1) It is read by screen readers in place of images allowing the content and function of the image to be accessible to those with visual or certain cognitive disabilities.
2) It is displayed in place of the image in web browsers that don't support the display of images or when the user has chosen not to view images.
3) It provides a semantic meaning and description to images which can be read by search engines or be used to later determine the content of the image from page context alone.
  • Accessibility is the practice of making websites as easy to use as possible for people with disabilities.
  • HTML standards: every image must have an ALT attribute.
  • Appropriate alternative text depends heavily on the image's context.
  • Alternative text should presents the content and function of the image, and be succinct.
  • Alt text of a functional image (e.g., an image within a link) should describe the function as well as the content.
  • Decorative images (if not put into background for some reason) still need an alt attribute, but it should be null (alt="").
  • Alternative text should not use the phrases "image of…" or "graphic of…".
  • Reading: Appropriate Use of Alternative Text
  • Reading: Guidelines on alt texts in img elements

Background images

  • A background image is an image that goes in the background of a web page, or part of a web page.
  • Background images can be applied to the whole page or to individual elements on the page, using CSS.
  • Background images are useful to create accessible sites using web standards techniques.
  • When should you use background images?
    • You should code any image which is purely decorative as a background image, using CSS.
    • Only images which are an essential part of the content of the page should be coded into the HTML as foreground image (using the <img ... /> tag.)
    • Study that example: http://www.blacksofsopwell.com/
    Example: HTML code
     <a href="xyz" title="view all Content by Conran range">
        <img src="../abc.jpg" alt="Content by Conran Beatrix Armchair" width="295" height="295" />
     </a>
Example: CSS code
      body {
        font: normal 14px/21px Arial, Helvetica, sans-serif;
        color: #686561;
        text-align: center;
        background: #FFFFFF url(../_img/wallpaper_back_4.jpg) repeat-y center top; 
      }

Case Studies for class discussion:


Thanks for Reading

If you would rather like to have this lecture note in printed format, please click the print action link in the top right corner.

If you find any problem in this lecture note, please feel free to tell Steven via steven [at] findaway.hk.

Edit - History - Print - Recent Changes - Search
Page last modified on October 06, 2011, at 10:01 AM