|
|||||||||||||||||
DRAW 8 and 9 are smarter. When you choose Paletted as the color palette, DRAW studies the colors actually contained in the drawing and creates a subset of the 256-color palette from them. You may only use a few dozen colors from the 256-color palette. You may only use 16...or four...or two. But that doesnt mean that you could get away with the 16-color palette, because those wouldnt necessarily be the correct 16 colors. When you choose Paletted, you are permitting DRAW to determine the size of the palette, based on the colors you are actually using in your drawing. With all of this said, re-export your rectanglethis time as a Paletted image instead of a 16-color graphicand see if your browser doesnt show you a clean and smooth fountain fill, like ours in Figure 20.5.
Creating Transparent Graphics One of the most important aspects of creating GIF files is the ability to control which parts of the graphic will be visible and which will be transparent. Follow these steps:
This code defines a light blue background color.
When you refresh the display, it should look similar to Figure 20.6, and thats bad. You rounded the corners of the rectangle, but DRAW still uses a rectangular area to define the space of the graphic (as it does for all exported graphics). The unsightly white spaces are because neither DRAW nor your browser understands that you only want the graphic to display, not the rectangular area in which the graphic sits.
Fortunately this is easy to fix:
Creating Interlaced Graphics As we have already said, and will say several more times, the display speed of a Web page is critical to its success. Graphics are the most common reason for a Web page being slow to load...too bad they are also crucial to your pages appearance. You can help matters by creating interlaced GIF files for your larger graphics (graphics over 50KB in size). You might be familiar with the term interlaced if you have recently bought a display monitor for your computer. One of the important qualities of a professional monitor is that it be non-interlaced. An interlaced display does not draw every scan line in succession from top to bottom; instead, it draws every other or every third and then goes back and draws the others. This is easier for manufacturers to produce and makes for a cheaper monitor. A non-interlaced monitor is greatly preferred, as it draws your screen much more smoothly and crisply. With Web graphics, though, an interlaced graphic can be a very good thing. An interlaced graphic does not draw itself completely from top to bottom, but instead first appears as a very rough representation. Then on the second pass, it fills in a bit more detail. Still more on the third, and more on the fourth and fifth. If youre visiting a site and dont need to see the entire graphic, youll appreciate getting a low-resolution glimpse of it so you can decide whether to click on it or move on. That is the idea behind creating interlaced GIF files: you let your visitors have a quick look at a graphic without forcing them to sit through the whole show. There is nothing to creating interlaced files. On the same dialog where you defined transparency, simply check the Interlace Image box, and youre done. The ABCs of Anti-AliasingAnti-aliasing can spell the difference between a great Web graphic and an ugly one. Anti-aliasing is like dithering, in that it adds other colors to smooth out harsh transitions. Dithering adds white to colors to soften transitions, while anti-aliasing smoothes jagged edges by adding an intermediate color, be it white or another color. Figure 20.7 shows the anti-aliasing effect with a very simple graphica rounded letter. You dont need any labels to know which is whichthe one that is noticeably smoother and cleaner is the one that was created with Anti-aliasing checked during export.
While it is obvious which looks better, it is not at all obvious why. You would need a much closer inspection to understand what anti-aliasing is actually doing, and Figure 20.8 offers the pixels eye view. In this close-up of the curved portion of the letter, you can see that the anti-aliased version on the right adds gray pixels to smooth out the journey around the curve. So its not rocket scienceits the simple introduction of intermediate-colored pixels at the edges of objects.
We will have a lot more to say about anti-aliasing in Chapter 22.
|
|||||||||||||||||
|