There's one little problem with bitmap graphics: a single graphic can be made up of a very large
number of individual dots, or pixels. For example, this innocent little arrow graphic on the right consists of
a grid of dots thirty high and thirty wide, or (gulp) nine hundred individual dots. In comparison,
many entire Web pages contain fewer than a thousand individual characters of text. And that's nothing.
The image we used earlier of the Grand Canyon is 640 pixels wide by 480 pixels
high, for a grand total of 307,200 pixels. For a color image, you need at least 1 byte for each pixel to
store the color, and for high-quality images you actually need 3 (which means that our Grand Canyon picture
saved in high quality color format would take up almost one million bytes). Obviously graphics can grow very large
very fast. Since the speed that a Web page loads is directly proportional to the number of bytes that have
to be transmitted, keeping file sizes down is extremely important, especially if users are accessing pages
via phone lines and modems.
![]() |
![]() |
| File size: 47K | File size: 14K |
![]() |
![]() |
| File size: 8K | File size: 6K |
![]() |
![]() |
| File size: 3K | File size: 2K |
HEIGHT and WIDTH
attributes in the <IMG> tag, like this:<IMG SRC="gcanyon.gif" HEIGHT="188" WIDTH="250">
|
![]() |
| Resized in browser | Resized using Photopaint |
There's one major advantage to the GIF file format, and that's the ability to set one of the colors as
"transparent." This means that any pixels of that color in the image will become invisible when the
graphic is displayed, allowing any background color or image to show through. For example, consider this
image:
In its "raw" form, the green surrounding the image covers anything beneath it. However, using image
editing software we can select the green as our "transparent" color, making the image look like this:
![]() |
| Terms to know from this lesson |
| Vector graphic: A graphic file which contains instructions for drawing an image step by step. |
| Bitmap graphic: A graphic file which contains detailed information on each individual pixel used to make up an image. |
| Lossless compression: A form of image compression in which the compressed image is absolutely identical to the original when displayed. |
| Lossy compression: A form of image compression which discards information not readily visible to the eye, resulting in the displayed image not being exactly identical to the original. The greater the amount of compression applied, the less the compressed image resembles the original. |
HEIGHT attribute: In the <IMG> tag, used
to set the height of a displayed graphic in pixels. |
| Transparent GIF: A GIF file in which one color is designated as "transparent," meaning that when displayed in a browser any pixels of the transparent color will be "invisible," allowing any color or image behind to show through. |
|
|
|
|
|
|
|
|
| |