Choosing the best file format
Before we start going crazy with our images on the website, we need to understand some basics about the type of image file formats we can use on the Web and how to choose the best one for the job. As mentioned, there are three image formats that are supported by nearly all web browsers. The one you pick depends on how many colors are there in your image and whether it has any transparent areas.
They are as follows:
1. JPEG
2. GIF
3. PNG
Here's an overview of each image file format:
JPEG
JPEG (.jpg
) stands for Joint Photographic Experts Group and was developed to store photographic images. This format supports millions of colors, but is known as a lossy format, meaning it throws away fine details to compress the image into a smaller file.
The good news is that we can choose the level of compression when we save an image in a JPEG format. It's possible to set the amount of compression on a scale of 0–100 (0 is the highest compression and lowest quality; 100 is the least...