There are a variety of image formats available. Most have a variety of strengths and weaknesses. Usage really depends on purpose—on what you want to accomplish.
Things to consider
- Transparency: the ability to view a background color, image, or text through a selection of the image
- Animation: the ability to contain multiple images within one file to create animation
- Compression: the ability to make the file smaller by reducing image quality. Lossless compression does not reduce image quality; lossy compression does.
- Optimization: often refers to reducing file size by reducing number of colors within the image
- Interlacing: display every other line of the image, then fill in to give the impression of faster download time
- Antialiasing: blurs the edges to provide a smooth look
File Formats
Graphics Interchange Format (GIF)
- Maximum number of colors: 256
- Best use: line drawings or items with solid tones
- Transparency: yes in GIF89A version
- Animation: Yes
- Compression: Lossless
- Optimization: Possible by reducing number of colors
- Interlacing: Yes
Joint Photographic Experts Group (JPEG)
- Maximum number of colors: 16.7 million
- Best use: photography
- Transparency: No
- Animation: No
- Compression: Lossy
- Optimization: Possible by reducing image quality
- Interlacing: Possible if you use a progressive jpeg
Portable Network Graphics (PNG)
- Maximum number of colors: 281,474,976,710,656 colors
- Best use: Depends: web images
- Transparency: Yes
- Animation: Yes in an unusual version with a different extension (rare)
- Compression: Lossless
- Optimization: Possible may result in loss of detail
- Interlacing: Yes
WebP
- Maximum number of colors: Difficult to determine at this time
- Best use: unclear: support is not universal
- Transparency: Yes
- Animation: Yes
- Compression: Lossy AND lossless
- Optimization: generally by reduction in quality
- Interlacing: unknown
- Created by Google in 2010
RAW Image Files
- There are dozens of variations. This file format captures the raw data from the camera sensor. Further processing is required before sharing: these are essentially high quality digital negatives. Professional photographers often prefer this format; however, many camera manufacturers have their own formats. There are many great discussions available online. We will NOT use raw images for web pages; they are often huge and most web browsers cannot display them.
High Efficiency Image Format (HEIF)
- This is Apple’s new format. Details are still emerging and can be found online.