HTML and Images
Images are one of the basic building blocks of a web page. The Image element <IMG> is used to insert images in an HTML file. Several attributes control the display and alignment of images.
Design Considerations
Design Principles: Images should be integrated into the overall design of the web site. Consider basic design principles when adding images to a page. Images should add to the content of a page rather than detract from it; they should add to the visual unity rather than distract.
| bad | good |
Usability: The effective use of images requires an understanding of and proper use of web technologies. Appropriate file types, file size and download time, site organization and naming conventions are important considerations when using images.
Color: Color is one of the basic elements of design and an important aspect of web page design. It is critical to understand the basic concepts (e.g. color systems, web safe colors) and terms (e.g. RGB, hexidecimal) of color to effectively create web pages.

| web-safe colors | visibone chart |
The IMG element
The Image element <IMG> places an external image in the document. It does not require a closing tag. These are also called inline images since are part of the flow of the page content. The SRC attribute (Source) is required; it specifies the pathname of the image file.
<IMG SRC="images/balloon.gif" >

IMG Attributes
IMG Display Atributes: control the display of the image
<IMG SRC="images/balloon.gif" width="200" height="200"
alt="balloon detail" border="0">
| image attributes |
IMG Alignment Atributes: control the position of the image in relation to flow of text, VSPACE and HSPACE work in conjunction with ALIGN. The ALIGN attribute also causes text to wrap around image.
<IMG SRC="images/balloon.gif" align="right" hspace="10">
To prevent text from wrapping around an aligned image use the <BR> tag with clear attribute:
<BR clear="all">
| using align |
Graphic File Formats
The two most common web graphic file formats are JPEG and GIF. Working with web graphics requires a basic understanding of file formats and their properties.
| formats |
JPEG files: Joint Photographic Experts Group
Optimizing JPEGs
JPEG file size tied to complexity of images
Find balance between amount of compression and image quality
Smoothing out images (reducing areas of strong contrast and detail in original image) results in smaller compressed file, for example applying Gaussian Blur can smooth out an image
GIF files: Graphics Interchange Format
Optimizing GIFs
GIF files compress horizontally (consistent color across row results in smaller file size) for example, vertical gradients compress better than horizontal
Antialiased text requires more colors than aliased text
| gif effects | gradients | animations |
Other Formats: several other image file formats can be used on the web
| comparison |