|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Alignment problems are less of an issue with a custom rule, but you should keep a couple of rules in mind:
Graphic Storage FormatsTechnically, Web graphics can be stored in any format, but only two formats display inline on all of todays popular graphical browsers: GIF and JPEG. A third format, PNG, is gaining ground, and you should expect to see full inline support for PNG graphics soon. Other graphics formats have to be displayed by a helper application, which is launched by the browser when it detects a format it cant display.
GIFGraphics Interchange Format (GIF) was originally developed for users of CompuServe as a standard for storing image files. The GIF standards have undergone a couple of revisions since their inception. The current standard is GIF89a. Graphics stored in GIF are limited to 256 colors. Because full-color photos require many more colors to look sharp, you shouldnt store full-color photos as GIFs. GIF is best used with line art, logos, and icons. If you do store a full-color photo as a GIF, its palette is reduced to just 256 colors, and the photo will not look as good on your Web page. In spite of a limited number of colors, the GIF89a standard supports the following three Web page effects:
JPEGJoint Picture Experts Group (JPEG) refers to a set of formats that support full-color images and stores them in a compressed form. JPEG is a 24-bit storage format that allows for 224 or 16,777,216 colors! With that much color data, it is easy to see why some form of compression is necessary. Typically, you can control the degree of compression at the time you create the JPEG file. Keep in mind that the more you compress the image, the more you reduce the images sharpness. Although JPEG is great for full-color images, it does not permit some of the nice effects that GIF does. Transparency is not possible with JPEG images because the compression tends to make small mathematical changes to the image data. With the exception of a server-push approach, animation is not yet possible with JPEGs. An analogy to interlaced GIFs exists, however. The progressive JPEG (p-JPEG) format has recently emerged, which gives the effect of an image fading in the same as an interlaced GIF would. PNGThe GIF Format began to fall out of favor with the Internet community when, in 1990, Unisys and CompuServe announced their intention to collect royalties for use of the format. The rationale behind this announcement was that GIF was developed by CompuServe and used a compression technique developed by Unisys, so the two companies were entitled to compensation. Most of the rest of the world did not share this philosophy, however, and, as part of the fallout, the Portable Network Graphics (PNG, pronounced ping) working group was formed and began drafting a proposal for this new, open format. In October 1996, the World Wide Web Consortium accepted the proposed PNG standard as a recommendation. The PNG format is able to support the two major effects that originally made GIFs so popular: transparency and interlacing. In fact, PNG is an improvement over GIF in that it implements these effects in a more flexible way. Specifically, for transparency, PNG provides for an alpha channel that supports up to 254 levels of partial transparencyin contrast to the GIFs approach, which supports only two levels: totally transparent or totally opaque. For interlacing, PNG employs a seven-pass, two-dimensional interlacing scheme that presents initial image data eight times faster than one-dimensional GIF interlacing.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |