File Formats and File SizeThe first thing you need to learn about preparing web graphics is the type of file format to use. There are two standard choices: GIF (Graphics Interchange Format) and JPEG (Joint Photographic Experts Group). There's also a third format known as PNG (Portable Network Graphics). It's actually been out for several years and promises to be the best choice of all three, but it has never really caught on. Use it if you like it, but be aware that there might still be a few folks out there whose software can't read PNG files.The most important thing to remember, regardless of the file format you decide to use, is that the Web has limited bandwidth. This means that if you create an absolutely beautiful image and it weighs in at something like 4MB, it will take forever to download on a 56K modembetter than 10 minutes. This is not to say that you can't create images with as large a file size as you want. I am just suggesting that few Web surfers out there will have the patience to sit and wait while your 4MB image downloads. If you know that your primary audience is surfing from home with slower modems, you might want to keep your web page images under 30KB apiecea size that a 56K modem can download in a comfortable six seconds. This is an area where ImageReady can be a big help. It lets you decide how small you can save a file without sacrificing quality.
JPEG (Joint Photographic Experts Group)Depending on your needs, JPEG could be the best file format for you. It is great for photographs and other continuous tone (full-color) images, primarily because it lets you use 16 million colors. JPEG maintains color information but does, however, employ a lossy compression scheme, which means that you can adjust and reduce the file sizeat the expense of the image quality.If you're creating JPEGs for the Web, you need to work in RGB mode within Photoshop. This is reasonable because RGB is the "monitor" viewing mode, and Web images are going to be seen on, guess what: an RGB monitor. ImageReady has only one mode, RGB, which is all it needs. (You can't print from ImageReady.)When you're working in Photoshop, choosing File Figure 24.2. As a JPEG in high, medium, and low quality.[View full size image] ![]() Figure 24.3. You have the same options in ImageReady as in Photoshop.[View full size image] ![]() Figure 24.4. The JPEG Options box lets you choose image quality and how the picture is loaded into a browser.![]()
GIF (Graphics Interchange Format)GIFs are another option for web file formats. Because they're limited to 256 colors, they're not as good as JPEG for continuous tone art, but they're great for line art, logos, and anything with limited color. The GIF format also lets you save files with transparent backgrounds, which is extremely useful when you are creating buttons and other round graphics. Furthermore, you can animate a GIF.
Figure 24.5. You can set the GIF colors according to what's needed for your image. For this button (shown in ImageReady), I only needed a few shades of pink and gray.[View full size image] ![]() PNG (Portable Network Graphics)There are two kinds of PNG: 8-bit and 24-bit. The PNG-8 format uses 8-bit color, which means that each image can contain only 256 colors. Like the GIF format, PNG-8 compresses solid areas of color very well while preserving sharp detail, such as that in line art, logos, or illustrations with type. The PNG-8 format uses a lossless compression method, with no data discarded during compression. However, because PNG-8 files are 8-bit color, optimizing an original 24-bit imagewhich can contain millions of colorsas a PNG-8 will degrade image quality. PNG-8 files use more advanced compression schemes than GIF, and they can be 10%30% smaller than GIF files of the same image, depending on the image's color patterns.PNG-24 file format uses 24-bit color and is suitable for continuous-tone images. PNG-24 uses a lossless compression scheme, so that you never lose image data when you save in this format. However, as a result, PNG-24 files can be much larger than JPEG files of the same image. PNG-24 format is recommended only when working with a continuous-tone image that includes multilevel (variable) transparency, such as you would have in an anti-aliased image on a transparent layer. (Multilevel transparency is supported by the PNG-24 format but not the JPEG format.)Bottom line: If you would consider GIF for an image, consider PNG-8 as well. It might give you a smaller file, and can do the job well. If you're thinking about JPEG, consider PNG-24 if your picture has multilevel transparency. If it's a straight image, JPEG will probably give you a smaller, more efficient file. Just remember that if you choose PNG, some users with older browsers may not be able to view your images. |