On the web today, GIF, PNG and JPEG are the most common and widely supported image file formats. Choosing appropriately, cropping and resizing images is important to keep pages lightweight and quick to load. Below is a guide to explain how each of these file formats work, when to use them and why.
JPEG format is intended for photo-style images only: photographs, movie stills, computer game stills, etc.
The GIF and PNG formats are ideal for compressing graphics that contain flat areas of plain color, as well as text.
Use PNG to compress text, line art, comic strip style illustrations, screenshots of applications, etc. As a lossless format it won't distort or alter the original image and allows fine lines and other details to be reproduced accurately. For typical web use, stick to 8 bit (256 color).
Today PNG has largely replaced the GIF format. GIF is traditionally used for line art, text or comic-style illustrations where the 256 color limitation is desired. Many feel that the only real value in the format is for animations.