Previous Issue | Search NetBITS | NetBITS Home Page | Next Issue

NetBITS Logo

NetBITS#007/06-Nov-97

Ever wondered about all those graphics you see on the Web? NetBITS editor in chief Glenn Fleishman compares and contrasts the two main types of graphics on the Web, GIF and JPEG, and introduces PNG, a newcomer you'll see more of soon. In other articles we update our coverage of spam, debunk a rumor floating around via email, present a bit more information about telephone systems, and explain what happens when you address email incorrectly.

Contents:

Copyright 1997 TidBITS Electronic Publishing. All rights reserved. To subscribe to our weekly list, email <netbits-on@netbits.net>. Thanks to our sponsors for their financial support of NetBITS.


NetBITS Updates/06-Nov-97

Oooo, Canada! I confess myself a Canadophile, especially after flying Air Canada recently, and Canada is on the forefront of the unsolicited commercial email (UCE) or "spam" issue as Janet Osborne <osborne@cc.umanitoba.ca> pointed out in email. The Canadian Direct Marketing Association (CDMA) now requires its members to do opt-in solicitations: you have to explicitly sign up for a solicitation ahead of time; as opposed to opt-out, where you must specifically ask that you be removed after receiving a solicitation. The CDMA represents about 80 percent of Canadian marketers.

<http://www.cdma.org/new/nr_internet.html>

Meanwhile, the Direct Marketing Association (DMA), the United States counterpart, merely urges its members to follow good business practices and allow easy opt-out mechanisms from UCE - but not to avoid it altogether.

<http://www.the-dma.org/busasst6/busasst-onmarkprivpr6a7.shtml>

Membership in the CDMA or DMA acts as a seal of credibility for direct marketers. In the case of the CDMA, you might choose to only do business with companies that do direct mail and are members. If you're an American, consider sending email to the DMA to let them know that you think they should follow the CDMA lead - before legislation forces them to.

And, shades of Heloise, here's a simple consumer tip while we have these Web sites handy. If you've ever wanted to get yourself off the majority of unsolicited phone call and snail mail lists, check the Web pages below for more information about the DMA's Telephone Preference Service and Mail Preference Service, and the CDMA's "Do Not Mail / Do Not Call Service." They really work. (Once again, the Canadians are ahead: you can submit both telephone and snail mail bans online, where the DMA requires it through regular mail.) [GF]

<http://www.the-dma.org/consass5/consasst-tps5a2.shtml>
<http://www.the-dma.org/consass5/consasst-mps5a3.shtml>
<http://www.cdma.org/consumers/dnm_dnc.html>

AOL 4.0 Spawn of Satan? Folks, never believe anything you read on the Internet, particularly in heavily forwarded email, unless you can verify it personally. That tongue-in-cheek hyperbole aside, we've seen a bunch of copies of a letter purportedly from a now-fired AOL staffer who, with the help of his cohorts, discovered the AOL 4.0 software currently in development has a secret feature enabling AOL management to retrieve any information they want from a user's hard drive whenever that user is logged into AOL.

Horse hockey.

Here's a lesson in prima facie logic - this claim is absurd. Even if AOL had the stupid, legally dangerous, company-destroying idea of doing this and had, in fact, implemented such a data sucker, it would still be impossible to be get away with it.

As the world's largest commercial online service, there's a hypersensitivity to any change AOL might make. Remember the massive outcry when AOL tried to change the usage agreement to allow the sales of subscribers' phone numbers to telemarketers? If AOL was insane enough to implement such a feature, those who watch AOL's every move would discover it quickly, either by decompiling the software (illegal in some cases, and time-consuming to analyze, but easy); or by using monitoring tools to watch the data their machines send to AOL.

Also, think of the bandwidth problems. For AOL to retrieve any amount of useful material from someone's hard drive, they would have to take over that person's connection. Given the relatively slow speed of modems, that's unlikely to go unnoticed - if your modem's transmit light is pegged on and your hard drive is grinding constantly, you might become suspicious.

A similar libel was spread about Prodigy some years ago. Users investigating a file that the Prodigy software stored on their machine found bits and pieces of files from all over their hard drive. This was alarming, until the truth came out: it was just some poor programming, not an attempt to hijack data. TidBITS covered that issue back in TidBITS-060 in 1991; you might find that coverage interesting in relation to the current scare. [GF]

<http://db.tidbits.com/getbits.acgi?tbart=03524>


NetBITS sponsored by DigitalThink.


A Closer View of Web Graphics

by Glenn Fleishman <glenn@netbits.net>

Graphics are an integral part of the Web, but the art and science of using them effectively can be confusing for novices and professionals alike. Whether you're a designer, work on a Web development team, or just want to know why the images on your screen look lousy on one site and great on another, this article will help you choose and use the main graphics formats on the Web today: GIF, JPEG, and a new contender, PNG. In the end, you'll have some mental ammunition for when people start babbling about "indexing images to 8 bits," or the wonders of adding transparency to an interlaced GIF's Web-safe color palette.

GIFts and More for Slow Modems -- From the beginning of time, GIF (Graphics Interchange Format, pronounced "jiff" as reported in NetBITS-003) files ruled the Web - that is, since 1993. The folks who brought you NCSA Mosaic - and later, Netscape Navigator - used GIF as the ideal base format for graphics because it has built-in compression and displays correctly on 8-bit-capable monitors (which can show only 256 colors at a time). The compression enabled images to zip across 9,600 and 14,400 bits per second (bps) modems - the cutting edge of technology back then - with ease, and the overall format let images display much the same on all systems.

Here at the end of 1997, it's hard to buy a computer with anything less than 16-bit video (thousands of colors), a 2 GB hard disk, and a 33.6 Kbps modem. However, tens of millions of people still use older machines; and even at 33.6 Kbps, graphics files take time to transfer.

Although the GIF format still dominates, JPEG (named for the body that created it, the Joint Photographic Experts Group) has become a widely used alternative, especially for more "photographic" images. And PNG (Portable Network Graphics) has finally begun to make inroads, especially now that Microsoft Internet Explorer 4.0 for Windows supports a basic version of PNG.

GIF, JPEG, and PNG each have their strengths, but to choose the right one for the right purpose, you must know how they compare in each of several major image file features. Each feature affects how users view images, including whether they look the way you intended, how fast they appear to load, and if they even appear at all. Specifically, you need to be aware of how each format deals with bit-depth, Web color palettes, compression, transparency, and interlacing.

Bit Depth -- Image files and computer video systems - a card or built-in circuitry - represent colors by assigning numbers to them. The more digits in that number (measured in "binary digits" or "bits"), the larger the possible number of colors that can be represented. So, a video system that can handle more bits can display or represent more colors. Most color computer video systems can display each of over 16 million different colors - eight bits each for red, green, and blue (known as RGB), or 24 bits overall - but not necessary all at the same time. To the human eye, 24-bit color creates a smooth and realistic image.

GIF files can store from one to eight bits of information for a pixel, meaning that they can contain as many as 256 different colors in the same file, or as few as two. JPEG can store 8-bit grayscale or 24-bit color images. PNG can do both - even in the same file.

However, not all computer configurations can display 24-bit color (millions of colors), so you must account for different bit depths, or the number of bits the computer can handle. If you're not viewing a 24-bit file or are viewing one without a 24-bit video card, you can see only a limited number of selections from that 16-million-plus color palette. The amount of memory in a video card or allotted to built-in video circuitry determines how many pixels it can display onscreen, and how many bits are allotted to each pixel for colors. This is why some computers are only able to use 8-bit or 16-bit color.

For instance, I have a PowerBook 3400c, which can do 16-bit color when it displays 800 by 600 pixels onscreen. When I go up to 832 by 624 on an external monitor, the PowerBook lacks enough video memory to handle a 16-bit color depth; instead, I'm suddenly limited to 256 colors.

On the other hand, my Windows 95 machine has a Diamond Stealth S220 card with 4 MB of video RAM. It can do 24-bit color at up to about 1,200 by 1,000 pixels.

So what happens when I display a 24-bit JPEG in 8-bit video on my external Macintosh monitor? I get dithering: a pattern of colored dots that tries to fool the eye into seeing a color that the video circuitry can't display. Dithering can look spotty and grotty, and might not convey the original effect. Fortunately, there are techniques for controlling how an image dithers at the content-creation stage; if done properly, a person's Web browser shouldn't have to impose its own dithering. Many Photoshop plug-ins and image editing programs now include the ability to tweak the impact of dithering.

Palettes -- Computers can work only with a finite number of colors, defined in sets called palettes. Since GIF can use only a maximum of 256 colors (8-bit), the colors are stored in an "indexed color palette," which contains the limited number of colors selected from the broader range of full, 24-bit color. In many image editing programs, you can open a 24-bit file - which doesn't have a palette per se, since it can represent every RGB color - and convert the file's colors to indexed colors.

When creating images for the Web, choosing the right indexed color palette is vital to making your 24-bit image look as good as possible in only eight bits. Many designers pick the "Web safe palette" (also known as the "browser safe palette" or "Netscape safe palette"), a collection of 216 colors that (in theory) should display the same on all machines that have at least 8-bit color monitors. What happened to the other 40 colors? Typically, they're reserved by the user's operating system and/or the Web browser being used to view the image. The precise details vary between platforms, but suffice to say the 216 colors in the Web palette are the ones most likely to be shown to users without dithering or substitution.

You don't have to stick with all 216 or 256 colors if you don't want to. In fact, the fewer the number of colors, the more an image will compress when saved as a GIF (see below for more on compression). Many image editing programs let you specify a bit depth from one to eight or a specific number of colors from 1 to 256. You can also choose to generate an adaptive palette, which will have the best set of colors needed to represent the image. The image can be converted to its palette either by mapping all colors to ones in the palette, or by dithering.

For images with flat colors (large areas of single colors, like logos, titles, or cartoon-type drawing), you can often get by with just 16 or 32 colors; for photographic images under indexed-color mode, you might have to use the adaptive option to achieve the ideal set of colors; and for displaying lots of different images on the same Web page, using the Web-safe palette for all the images means that all the colors will display correctly. The biggest problem with indexed color involves a situation where an 8-bit monitor tries to display multiple images having different 8-bit palettes: the computer is forced to dither - it can only display a total of 256 colors at the same time, regardless of how many colors are in all the images onscreen at once - and the results can be unpredictable.

As opposed to GIF, JPEG can store 8-bit grayscale or 24-bit color image data, which makes it a better option for storing photographic images that don't have large areas of flat colors. PNG, the newcomer to the Web image arena, represents the best of both depths: it can store both a "deep" bitmap (16 or 24 bits) and an indexed color palette (8 bits) in the same file. So, in theory, but not yet in practice, on a machine that can display 24-bit color PNG will display the full color version. On an 8-bit machine, it will display just the indexed color data.

When selecting a graphics format, keep in mind that bit depth and palette size relate directly to file size, all other things being equal. A 24-bit JPEG, with minimal JPEG compression can be three times as large as the same file saved as an 8-bit GIF. If you go down to 32 colors for a GIF, the fewer colors means an even smaller file size and overall better compression, too. The larger the file, the longer it takes to transmit - and the longer it takes an older, slower machine to display it in a Web browser.

Compression -- GIF, JPEG, and PNG each have a mandatory method of compression built-in. GIF and PNG use lossless methods, which means that the image data after compression and then decompression is identical, pixel for pixel, with the original image.

Lossless compression uses a variety of techniques, including finding patterns in the data (identical series of ones and zeroes) and replacing them with small tokens pointing to the full pattern. Other algorithms look for runs of the same number - like a thousand of "10" in a row - and replace the run with a code that says "1,000 10's."

JPEG, on the other hand, is lossy, an awful-sounding word coined by engineers. Lossy compression means the compressed image is an abstraction or an approximation of the original information. After compression and then decompression, the file won't be identical to the original. JPEG has a range of compression options from most accurate (worst compression) to least faithful (best compression), so depending on your setting, you may not even see a difference in the compressed image. Finding the right balance between image quality and file size will be a matter of your choosing (and often a bit of trial and error).

Transparency -- One of the great advantages of the GIF and PNG formats is the ability to specify transparency in images, so you're not stuck with rectangular, opaque graphics all the time. You can specify that a single color or an entire channel - a set of tones - allows images or text behind it to show through wherever that color or tone appears.

PNG allows complex transparency, where you can control the opacity of the PNG image as it sits on top of type or graphics on the Web page itself. This is called "alpha channel" transparency: you use a grayscale image in a separate channel to control what parts of the PNG image appear, what parts are mixed (say a 50-percent value of the image and a 50-percent value of what's underneath the image), and what parts are totally transparent (allowing the underlying art to show through). This can be as simple as a black rectangle that knocks out a piece of the PNG file to let text show though; or a complex set of tones that blends the PNG image with another image behind it, creating composites - a blend of different images - on the fly.

GIF allows only individual colors to be transparent, making it harder to nicely blend the transition between the GIF image and what's behind it. (Some image editors only allow a single color, while others will allow several.) When that color (or those colors) appear in a GIF image, the background image or color shows through 100 percent for that pixel. Designers often use this fact to give a GIF a softer edge; they make the background color of the GIF the same as the background color on the Web page where the graphic will display.

Current support for PNG in Internet Explorer 4 doesn't fully implement transparency features, but when browsers do allow for this, it will be easy for Web page designers to blend photographs and type in a way that seems more photographic - or maybe even more creative. There will be fewer limits in how they can present material on the Web versus how they can currently use image editing programs to create interesting effects.

Interlacing -- Interlacing, also called progressive rendering, happens when an image is stored and transmitted in such a way that the computer gradually fills in more detail as the image displays. Designers use interlacing to make images appear to load more rapidly - even though it's really just a matter of perception.

With progressive GIF and JPEG rendering, the image loads a line at a time, where a line is the full width of the image by a single pixel tall. In an interlaced GIF that's, say, 16 pixels tall, single-pixel stripes of the image are stored in this order 1, 9, 5, 13, 3, 7, 11, 15, 2, 4, 6, 8, 10, 12, 14, 16. Some browsers will interpolate the missing lines until they fill in, so the image comes into focus slowly as it loads.

GIF interlacing is simply on or off in most implementations; JPEG interlacing has several options, where you can load lines of pixels farther apart in the image. Photoshop, for instance, allows 3, 5, and 6-line interleaving, so it loads every third, fifth, or sixth line, then starts on the next pass through the image until it's loaded. The more lines, the faster the first pass of the image comes in.

PNG interlacing is two-dimensional (rather than being based on lines), so single pixels are extracted both down and across the image in a regular, progressive pattern. The PNG spec points out that the first pass of a PNG image can display in one-eighth the time of the first pass of a GIF image. You'll see less detail, but the point of progressive rendering is that people viewing the image can make decisions - click a link, click the Back button, or go elsewhere - based on initial information, without waiting for the image to load completely.

Choosing Formats -- The choice is still clear for most online uses. GIF works everywhere and in pretty much the same way. For applications where you're reproducing lots of photographs - rather than artificial images generated by 3D illustration programs or fancy, rendered type - JPEG is probably more appropriate, because it can represent 24 bits of color and deliver a more photorealistic image. PNG looks to be the wave of the future, with its delivery of features such as complex transparency, great compression, plus support for indexed and full color palettes. However, the delay in supporting PNG in the major Web browsers (Navigator currently offers no support at all) has hindered its widespread acceptance.

[Glenn Fleishman is editor in chief of NetBITS and is currently writing the second edition of Real World Scanning and Halftones, a Peachpit Press book due out in January 1998.]


NetBITS sponsored by Peachpit Press.


FAQtoids 007

Question: Can email be "Returned to Sender?" Jo-Ann Duncan <jo-ann@quibble.com> wonders what happens to email that's addressed incorrectly. "I sent mail to a friend, and then thought perhaps she had changed her email address when I didn't hear back from her. If I send mail to someone with the wrong address does the message get lost in transit or does it come back to my computer in some way?"

Answer: In most cases, you should receive a message back, saying that your original message couldn't be delivered. In Internet terms, this is called a "bounce," and mail that comes back to you is said to have "bounced." The most common reason for a message to bounce is human error - you type the address slightly wrong. Computers are utterly literal, and if you send email to <aec@netbits.net> instead of <ace@netbits.net>, my mail server will bounce it back to you, since, unlike your friendly local postal employee, it can't figure out what you mean.
(If you don't receive a message back, it's conceivable that it has disappeared into the ether, but it's more likely that your friend simply hasn't gotten around to responding yet.)
There are two common types of bounces, "User unknown" and "Host unknown." Both are generally caused by mistakes in the recipient's email address, but "User unknown" bounces occur when you make a mistake in the username portion of the email address (the part before the @) and "Host unknown" bounces generally occur when you make a mistake in the domain name portion of the email address (the part after the @). The best way to avoid mistakes in email addresses is to use the address book feature of your email program, where you can create a nickname like "Adam" that maps to <ace@netbits.net>. Then, as long as you type the nickname correctly, your email program will replace it with the proper email address.
The main thing you can do when you receive a bounce is to send the message again if the text of the original message has been included. Some email programs, like Qualcomm's Eudora, even have a Send Again command (look in the Message menu) that can resend a bounced message. Otherwise, if you save your outgoing messages (a good idea) you can copy and paste the original text into a new message, making sure to enter the email address correctly this time. Unfortunately, if you don't save outgoing messages and the original text isn't in the bounce, you'll have to retype the entire thing.
Some bounces aren't your fault. If an ISP is moving machines or generally mucking with setups, mail might bounce temporarily until they fix the problem. In that situation, wait a day or so and send the message again. You might also receive bounces telling you that there are temporary delivery problems but that the server will continue to attempt to deliver the message. If that's true, do nothing unless the message bounces for good because it's likely the problems will be resolved automatically. Finally, some people change their addresses fairly frequently without informing their friends and colleagues. If that's true, you can try to send the message to another email address if you have it (look in the signature of a previous message - many people have multiple email addresses), or try to find out the new address by asking a mutual acquaintance or calling the recipient on the phone. [ACE]

[Please send us any and all questions surrounding the Web, email, or the best way to make brownies at <faqtoids@netbits.net>, and include your full name and email address. Questions may be edited for content and length. We cannot guarantee publication or a reply.]


NetBITS sponsored by Webreference.com.


NettersLetters/06-Nov-97

50 Pence for the Next 10 Minutes, Please -- Mark Townshend <phonetime@compuserve.com> wrote in response to Paul Durrant's letter last week in NetBITS-006 about how some UK ISPs don't maintain points of presence (POPs) all over the country, but rather forward calls to a central, vast modem pool. I asked Paul and Mark about how this was managed, since in England both the ISP (for the forwarding) and the customer (for regular metered service) had to pay per-minute charges. Paul also followed up with the fascinating statistic that five percent of all local calls in the UK are to Demon, an Internet service provider. Mark writes:

Most UK ISPs use non-geographic numbers to provide coverage of the whole UK. These numbers are called "Lo-call" and use STD codes which are charged to the caller as a local call. The ISP does have to pay for this inbound leg of the call. British Telecom, which is about the most expensive, charges 5.16 pence per minute peak and 3.42 pence per minute for off-peak calls if you commit to a five year contract and use 48 million minutes a year. [Editor's note: that's about three pounds or $5 U.S. per hour for peak usage and two pounds or $3.50 U.S. per hour for off-peak.] This is the charge to the recipient and is in addition to the cost to the caller.
All non-geographic numbers terminate at a normal telephone number and there can be advantages to calling the underlying geographic telephone number. At present, Cable & Wireless in the UK has a special offer for calls on Saturdays for the rest of the year. You can make any UK call for as long as you like and only pay 50 pence. This only works with geographic numbers and therefore all customers of ISPs that offer Lo-call access lose out. If you can get the underlying telephone number, then even if the resulting call is long distance, you can stay online for 23 hours and 59 minutes for 50 pence.

Paths to POPs -- John Baxter <jwbaxter@olympus.net>, a colleague of ours out on the Olympic Peninsula, notes that POPs aren't the only way for providers to build networks. Similar to the UK solution we mention above, U.S. ISPs have another option:

You may also be calling an auto-forwarding telephone number, which has a certain number of "paths" (connections) to some remote collection of modems. These are charged (to the operator) on a per-path basis or otherwise. They can be used to good advantage where there isn't sufficient demand to justify setting up a POP as defined last week in NetBITS.

[Please send letters to the editor to us at <letters@netbits.net>. Please include your full name and email address. Letters may be edited for content, grammar, and length. All letters become the property of TidBITS Electronic Publishing. We cannot guarantee publication or a reply.]


NetBITS sponsored by Northwest Nexus.


NetBITS sponsored by Point of Presence Company.


Non-profit, non-commercial publications and Web sites may reprint or link to articles if full credit is given. Others please contact us. We do not guarantee accuracy of articles. Caveat lector. Publication, product, and company names may be registered trademarks of their companies. NetBITS ISSN 1096-4908.

Previous Issue | Search NetBITS | NetBITS Home Page | Next Issue