22.04.2013 Views

HTML, XHTML & CSS

HTML, XHTML & CSS

HTML, XHTML & CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 7: Finding and Using Images<br />

✓ Joint Photographic Experts Group (JPEG): The JPEG file format supports<br />

24-bit color (millions of colors) and complex images, such as photographs.<br />

JPEG is cross-platform and application-independent. A good<br />

image editing tool can help you tweak the compression so you can strike<br />

an optimum balance between the image’s quality and its file size.<br />

✓ Portable Network Graphics (PNG): PNG is the latest cross-platform and<br />

application-independent image file format. It was developed to bring<br />

together the best aspects of GIF and JPEG. PNG has the same compression<br />

as GIF but supports 24-bit color (and even 32-bit color) like JPEG.<br />

Any good graphics editing tool, such as those mentioned in Chapter 23, allows<br />

you to save images in any of these formats. Experiment with them to see how<br />

converting a graphic from one format to another changes its appearance and<br />

file size, and then choose whichever format produces the best results.<br />

Table 7-1 shows guidelines for choosing a file format for images by type.<br />

Table 7-1 Choosing the Right File Format for an Image<br />

File<br />

Format<br />

GIF Line art and other images with<br />

few colors and less detail<br />

JPEG Photos and other images with<br />

millions of colors and lots of<br />

detail<br />

PNG Photos and other images with<br />

millions of colors and lots of<br />

detail<br />

Best Used For Watch Out<br />

Optimizing images<br />

Don’t use this format if you have a<br />

complex image or photo.<br />

Don’t use with line art. This format<br />

compromises too much quality when<br />

you compress the file.<br />

Don’t use with line art. PNG offers<br />

the best balance between quality<br />

and file size.<br />

As you build graphics for your Web page, maintain a healthy balance between file quality and file<br />

size. If you poke around with your favorite search engine, you can find good tutorials on trimming<br />

image file sizes and optimizing entire sites for fast download. For tips and tricks to help you build<br />

pages that download quickly, review these handy resources:<br />

✓ Optimizing images: www.yourhtmlsource.com/optimisation/image<br />

optimisation.html<br />

✓ Optimizing Web graphics: www.websiteoptimization.com/speed/12<br />

107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!