04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How images work<br />

Images are just images, right? Well, actually there are a zillion<br />

formats for images out there in the world, all <strong>with</strong> their own<br />

strengths and weaknesses. But luckily, only two of those formats<br />

are commonly used on the Web: JPEG and GIF. The only tricky<br />

part is deciding which to use when.<br />

What’s the difference between JPEG and GIF?<br />

Use JPEG for photos and<br />

complex graphics<br />

Works best for continuous tone images,<br />

like photographs.<br />

Can represent images <strong>with</strong> up to 16<br />

million different colors.<br />

Is a “lossy” format because to<br />

reduce the file size, it throws away<br />

some information about the image.<br />

Does not support transparency.<br />

adding images to your web pages<br />

Use GIF for images <strong>with</strong> solid<br />

colors, logos, and geometric shapes.<br />

Works best for images <strong>with</strong> a few<br />

solid colors, and images <strong>with</strong> lines,<br />

like logos, clip art, and small text in<br />

images.<br />

Can represent images <strong>with</strong> up to 256<br />

different colors.<br />

GIF also compresses the file to<br />

reduce its size, but doesn’t throw<br />

anything way. So, it is a “lossless”<br />

format.<br />

Allows one background color to be<br />

set to “transparent” so that anything<br />

underneath the image will show<br />

through.<br />

you are here 169

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

Saved successfully!

Ooh no, something went wrong!