Share this Page URL

Chapter 6. A Picture Is Worth a Thousand... > Images: Some Semi-Important Backgrou... - Pg. 61

A Picture Is Worth a Thousand Clicks: Working with Images 61 Yeah. As you see later on (in the section "The Nitty-Gritty at Last: The <IMG> Tag"), all you're really doing is, for each image you want to use, adding a tag to the document that says, in effect, "Yo! Mr. Browser! Insert image here." That tag specifies the name of the graphics file, so the browser just opens the file and displays the image. In other words, you have two files: your HTML file and a separate graphics file. It's the browser's job to combine them into your beautiful web page. Graphics formats: Can't we all just get along? Some computer wag once said that the nice thing about standards is that there are so many of them! Graphics files are no exception. It seems that every geek who ever gawked at a graphic has invented his own format for storing them on disk. And talk about alphabet soup! Why, there are images in GIF, JPEG, BMP, PCX, TIFF, DIB, EPS, and TGA formats, and those are just off the top of my head. How's a budding web page architect supposed to make sense of all this acronymic anarchy? Well, my would-be web welders, I bring tidings of great joy. You can toss most of that graphic traffic into the digital scrap heap because the web has standardized on just two formats--GIF and JPEG --that account for 99 percent of all web imagery. Oh happy day! Here's a quick look at them: · GIF--This was the original web graphics format. It's limited to 256 colors, so it's best for simple images: line art, clip art, text, and so on. GIFs are also useful for setting up images with trans- parent backgrounds (see "Giving a GIF a Transparent Background," later in this chapter) and for creating simple animations (see Chapter 11, "Making Your Web Pages Dance and Sing"). Webmaster Wisdom When you work with graphics files, bear in mind that GIF files use the .gif extension, while JPEG files use the .jpg or .jpeg extensions. · JPEG--This format (which gets its name from the Joint Photographic Experts Group that in- vented it; gee, don't they sound like a fun bunch of guys to hang out with?) supports complex images that have many millions of colors. The main advantage of JPEG files is that, given the same image, they're smaller than GIFs, so they take less time to download. This doesn't matter much with simple images, but digitized photographs and other high-quality images tend to be huge, but the JPEG format compresses these images so they're easier to manage. Webmaster Wisdom