Summary
Choose the Correct Format
- GIF is best for drawings with large areas of flat color
or simple patterns.
- You need GIF if you want a transparent color or animation.
- Don't overuse animation
- JPEG is best for photographic-quality images.
- Scanned images should almost always be saved as JPEG.
- You can adjust the quality at which JPEG saves a file
to balance image quality vs. file size.
- When in doubt, save in both formats or at several different
quality levels, and compare picture
quality and file size.
When Writing your HTML
- Always use the
alt=
attribute to provide alternate text.
- Alternate text should explain what the person can't see in the
image.
- Provide
width=
and height=
attributes
to make a page appear to load more quickly.
- The best case is to have the width and height you specify match
the image's dimensions exactly.
- For images with a small file size, use the
width=
and height=
attributes to scale
the image to your heart's content.
- Never use the
width=
and height=
attributes to make
a “thumbnail” preview of a very large file. Instead, make
a separate, smaller picture of the exact size that you desire.