While the ability to edit basic hypertext markup language (HTML) is a primary skill for Web development, no developer’s bag of tricks is complete without the ability to manipulate images. The Web is a visual medium, and developers and designers alike must take into consideration some of the major issues of image dimension, file size, and image compression.
Image Dimensions
Dimensions on the Web are measured in pixels.
As opposed to fixed measurements, a pixel is relative to the resolution of the target monitor. For the sake or argument, however, you could consider a pixel to be about the size of a pencil point.
Following are some common dimensions:
100 pixels wide by 100 pixels high

250 pixels wide by 200 pixels high

File Size
File size on the Web is generally measured in bytes. Since a byte is so small, most images are measured in kilobytes (Kb) or–if *really* large–in megabytes (Mb).
Since the Web works by transferring files from one computer (the server) to another (the client), the amount of time it takes for a page to load is directly proportional to the size of the files being transmitted.
As a result, file size on the Web is extremely important. When transmission speeds were slower (such as with 56k modems), the standard on the Web was that a page (and all associated graphics) shouldn’t be more than 50k. With increased bandwidth becoming standard, total file size (sometimes referred to as “weight”) has increased. It is still a good idea, however, to keep file size as small as possible (~100k).
Plain HTML pages usually aren’t the problem. A page with five paragraphs of text (around 450 words) weighs in at under 5k!
Problems arise when a page becomes bloated with unoptimized graphics, sound files, video, PowerPoint presentations, etc.
Moral: Try to keep the total file size of your images as small as possible!
Compression
Due to the fact that large files take longer to download through the Web, all images must be “optimized.” Optimization entails compressing the image down to the smallest possible file size.
Different types of graphics require different compression methods. For example, photographs should be compressed as a JPEG, while simple logos (with solid blocks of horizontally continuous color) should be compressed as GIF. Compression is generally accomplished in dedicated image software such as Photoshop Elements, Fireworks, or ImageReady.
Rule of thumb:
Lots of colors = JPEG
Solid colors = GIF
Photographs
Example

Appropriate compression method: JPEG
Graphics and illustrations (using large blocks of similar horizontal color)
Example

Appropriate compression method: GIF
PNG is a less-common format that has strengths and weaknesses of both JPG and GIF compression. While PNG is lossless (like GIF), the image size is larger.
Share This