Images play an important role in making your website lively and are basic part of web. Images are important aspect in any website’s performance, so you need image optimization /compression for better performance of your webpage. If you have large size images on your page then it’s going to take much time to load your page and user will definitely lose interest in such pages.
You can optimize your web pages by choosing right image format. The image formats commonly being used on web are JPEG, PNG and GIF format. Using any of these formats comes with its advantages and disadvantages. So there is a need to understand these formats before making a decision to use a particular format.
Joint Photographic Experts Group (JPEG) or JPG– It is a result of lossy compression technique as it reduces the size image by discarding details which are hard to notice by human eye. JPEG supports 16 million colors and therefore are better for images such as digital photographs and sceneries. But this format is not good for drawings (Drawings with straight lines and block diagrams), Clip arts and text based images. The level of compression determines the end file size. JPEG allows you to vary the degree of lossiness. If you want a very small file size, but can put up with a slightly poor quality image, you can set parameters accordingly.
Graphics Interchange Format (GIF)-This format of compressed image is saved using lossless compression technique, which means that you can restore an exact copy of the original. As GIF format supports only 256 colors so it doesn’t go well with Photos and sceneries. But its good for drawings, Logos and text based images. Thumbnails and clip art can be created using GIFs
Portable Network Graphics (PNG)- This format also useslossless compression technique as GIFs. Basically this is the replacement of GIF that doesn’t require patent license. PNG supports RGB/true color, Indexed colors and grayscale images. This format is basically for web and not for printing. The size depends on bit depth, total number of bits per pixel. PNG provides wider range of transparency than GIF but PNG is not supported in very old browsers and software.
The final call for a particular format depends on your requirements. While GIF and PNG are good for drawings, Clip Arts, Logos and text based images, JPEG is good for digital photographs and sceneries.
Other articles you may be interested in