Preparing Graphics for Web Use

After you decide which graphics format to use for a particular image, your next decision is how large the graphic should be—that is, how many pixels should comprise it. This is called the image’s resolution, and it is expressed in width and height. For example, an image that is 800x600 is 800 pixels wide and 600 pixels tall.

A graphic’s file size—how many bytes the file will take up on disk—has a direct relationship to its resolution. The more pixels in a graphic, the larger the file. You must strike a balance between making a graphic’s resolution high enough to display optimally and low enough to download quickly when users load your page.

There are two ways of controlling the size (in pixels) of a graphic on a Web ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.