Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Taking_Your_Talent_to_the_Web.pdf
Скачиваний:
5
Добавлен:
11.05.2015
Размер:
9.91 Mб
Скачать

Taking Your Talent to the Web

221

Save the VisiBone swatch so it is always available when you work in

Photoshop.

Now pat yourself on the back. Many of your peers have no idea that this special swatch exists, that it comes bundled with Photoshop, and that it can greatly ease the creation of meaningful and attractive color schemes for the Web. You are ahead of the game.

If you’re stuck using an older version of Photoshop or an alternative image editor, you can download the VisiBone palette free of charge at www.visibone.com. While there, help yourself to additional VisiBone palettes for other software programs you or your teammates use, including Adobe Illustrator and ImageReady, Macromedia Fireworks, Bare Bones BBEdit, Jasc Paint Shop Pro, Allaire HomeSite, MetaCreations Painter, or the GIMP (an image editor for Linux). You need it; they’ve got it.

For additional wisdom on the Color Cube, see Lynda Weinman’s site at www.lynda.com and David Siegel’s at www.killersites.com. You also might want to buy Weinman’s Designing Web Graphics and Coloring Web Graphics, both of which are available from New Riders Press, and are pretty much the standard industry texts. They are full of practical examples and offer stimulating and innovative ideas from the earliest days of web design.

Another standard industry text, David Siegel’s Creating Killer Websites, is also available from New Riders and also provides extensive information on the subjects we cover in this chapter. It’s a beautifully written book full of great ideas, but it is also a book of its time (1996), and many of the practices it preaches would now be considered harmful to the development of a semantic Web based on W3C Recommendations. We own and cherish this book, which was greatly influential in our development, and we recommend it as long as you know which of its visual techniques to shun. (If you’re unsure, wait for the book’s third Edition…we hear it’s coming soon.)

FORMAT THIS: GIFS, JPEGS, AND SUCH

Raster images come in at least as many formats as there are software programs and operating systems. On the Web, however, we tend to use two formats almost exclusively: GIF and JPEG. (As explained previously, animated GIFs are a special instance of the GIF format.)

222 HOW: Visual Tools: Format This

PNG is yet another web format, one that has been little supported in the past. Some newer browsers have begun to support PNG, though it is still far from ubiquitous. We will discuss it after thoroughly examining the GIF and JPEG formats—how they work, which types of images they deliver best, and how you can evolve strong stylistic concepts by understanding their limitations.

GIF

The Graphics Interchange Format (GIF) is older than the Web. In fact it is older than some web designers. GIF was developed in the 1980s by CompuServe, and you’ll often hear old-timers speak of “CompuServe GIFs.” You’ll also hear them talk about walking 12 miles to a one-room schoolhouse.

The Compuserve folks pronounced the word as if it were the name of the peanut butter (“Jiff”) and because they were the inventors, that is the correct pronunciation. Millions of people pronounce GIF with a hard “G,” however, so you might as well be a sniveling conformist and spend the rest of your career mispronouncing GIF while secretly suffering great guilt over it. GIFs are usually seen with a .GIF file extension, as in payme.GIF or payme.gif.

The GIF format renders in 8-bit color or lower, at your discretion. Two-color GIFs are not uncommon. GIF permits you to achieve crude transparency effects by marking one of your 216 (or fewer) colors as “transparent.” However, you must take care to anti-alias the foreground image against the transparent color, lest mismatched halos surround your graphics. Fortunately, GIF renders specific colors exactly, so it is an easy matter to match web page backgrounds to image backgrounds. The only caveat there is the previously mentioned heartbreak of 16-bit systems.

Above all, GIF enables you to save bandwidth without sacrificing quality. It employs the Unisys-patented Lempel Ziv Welch (LZW) algorithm

(www.dogma.net/markn/articles/lzw/lzw.htm) to efficiently compress solid color areas while preserving crisp detail. Though the format necessarily discards colors—for instance, when rendering a 24-bit image as a 16-color GIF—it does not blur or eliminate significant image details. For this reason, the GIF algorithm produces what is known as lossless compression.

Taking Your Talent to the Web

223

Loves logos, typography, and long walks in the woods

This combination of crisp detail and efficient compression makes GIF the format of choice for line art including typography, logos, and illustrations. As mentioned earlier, the GIF format can also be used to create animated images. When combined with JavaScript rollovers, animated GIFs can lend life and dynamism to a website. They can also create nausea and ennui. With animation and rollovers, as with Tabasco, a little goes a long way.

Animated GIFs have been supported in all graphical web browsers since Netscape 2.0 (1995), and nonanimated GIFs have been supported in graphical web browsers since before time began. For now we will continue to discuss the merits and uses of static (nonanimated) GIFs.

In spite of the fact that GIFs are found on millions of sites, the GIF format is not a W3C-recommended web standard. That’s because GIF gets its power from a patented algorithm. Unisys, the patent holder, is entitled to charge royalties on any software that employs the LZW algorithm—in other words, any software that can read or write GIFs. The revelation of Unisys’ right to charge a “GIF tax” spread panic among early web designers when it became widely known only after the entire Web seemed to be built with GIF images. It also led to the development of PNG, a GIF-like format with more advanced features and a nonproprietary compression algorithm.

GIF “royalties” do not work in the way that, say, photo rights work. You do not pay a fee each time you create a GIF image. Instead, software companies such as Adobe, Macromedia, and Corel render these tributes to Caesar. You pay your share one time only, and it is hidden in the purchase price of Photoshop, Fireworks, or any other software program that exports to the GIF format.

GIFs are not the format of choice for photography, paintings, and other subtly modulated images because they lack sufficient colors to reproduce these types of images and because the nuances in those images do not lend themselves to LZW compression. Photographic images tend to render better in the JPEG format (or PNG), and we’ll get to those formats soon enough.

224 HOW: Visual Tools: Format This

GIFs in Photoshop

In Photoshop, you can choose whether to save your image as a standard or interlaced GIF. The standard format is like a reader, taking in one letter after another, one word after another, one sentence after another. Standard GIFs store and display the bytes comprising an image’s pixels in their order of appearance: The first pixel in is the first pixel out. Thus, standard GIFs scroll onto the viewer’s screen pixel by pixel and line by line.

The interlaced format is like a nervous reader who keeps skipping ahead— from paragraph one to paragraph five, then back to paragraph one. Interlaced GIFs load in a parallel rather than linear sequence, allowing the total image to be rendered more quickly and then with greater detail as additional pixels are downloaded. This allows viewers to get a sense of the image before it has finished downloading.

Under the right conditions, interlaced GIFs might thus appear to load faster—and so may your site. The appearance is deceptive given that interlaced GIFs are often a few bytes larger than standard GIFs and therefore take a fractionally longer time to fully download. Moreover, the slight benefits of interlaced GIFs often evaporate when other conditions are factored in.

For one thing, the effectiveness of progressive GIFs depends on the viewer’s access speed. With a super-fast connection, images load so quickly that any progressive rendering benefits are lost. The format was something of a godsend not so long ago, when most web users were limited to 14.4 modems. Today, few are stuck with such abysmal speeds.

The effectiveness of progressive GIFs also depends on the browser. Some browsers do not show anything at all until all images are fully loaded; in those browsers, the progressive aspects of the image are entirely wasted. If anything, in such browsers, progressive GIFs delay the page by adding a few bytes to the overall download time.

Some browsers, such as Internet Explorer, give users a choice. Users may view each image as it downloads (best with slow connections), or they may choose to wait for the entire page to download and assemble itself in memory before appearing full-blown on the screen (best with fast connections). Users choose a viewing method in the Explorer Preferences dialog box. You have no way of knowing or controlling these user preferences.

Taking Your Talent to the Web

225

Beginning web designers often ask if they can control the loading order of images on a web page. Given what has just been explained, the answer is obviously “no,” because web users can choose (or their browsers may force them) to wait for the entire page to load. Beyond that, HTML has no means of controlling the loading order of images. And even if it did support such nuances, the unpredictability of HTTP calls (explained in Chapter 2) means that one image might halt in mid-download, not even appearing until another, called much later, has already popped into place. The more images per page, the greater the randomness of load order. View a busy thumbnail image gallery sometime to see this in action, assuming your browser allows you to watch images download one by one.

Avoid progressive GIFs when creating an image to be used as a background. Backgrounds do not appear until they have fully downloaded, so any “progressive” effects will be lost. Moreover, progressive GIF backgrounds can crash some older browsers.

Progressive GIFs also can be hazardous to animations because each succeeding frame of a progressive animated GIF will appear blurry, thus defeating the effort to create smooth motion effects.

They’re not great for JavaScript rollovers, either. You can offset the harmful, blurred quality of progressive GIFs in rollovers by preloading the images, a technique explained in the Chapter 11, “The Joy of JavaScript.” When preloaded via JavaScript, images download and are stored in the viewer’s cache even though they do not appear on the web page until triggered by some action on the viewer’s part (typically, moving the mouse over an image to which rollover effects have been applied). Any sane web designer who creates rollovers starts by preloading the alternate (replacement) images. But if the images are going to be preloaded anyway, there’s no sense in having them render progressively because the user will never see them until they have fully downloaded and cached.

One last tip while we’re in this area. Given that text loads instantly and images take time (see Chapter 2), designs that use HTML text above the fold will appear to load more quickly than those that bury their text further down on the screen. A web user waiting for images is a web user with nothing to do (except, perhaps, hit the Back button). A web user reading

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]