All of us know three famous image formats for publishing pictures on the web: .gif, .jpeg (.jpg), .png. Let’s see their features and which is suitable for each use.
Compuserve GIF (.gif): GIF format is suitable for small icons, buttons, logos and images with animation. It uses 8-bit color depth and compresses regions on the picture with the same color. During compression GIF loses no information (loseless compression), but when you compress a 24-bit image in GIF (8-bit), the image comes in less quality. GIF supports transparency in pitures and matte using for blending your pictures with your web site’s background. Every browser supports GIF format.
Joint Picture Experts Group (.jpeg, .jpg): One positive of jpeg against GIF is the support of 24-bit color, which means that it can picture images in better quality whith many colors. JPEG deletes picture information during compression. You can control how much information is deleted, by changing the output quality. The better quality you choose, the less information is deleted, but the files become larger. It is preferable to compress original images (like .tiff) to jpeg, because compressing a jpeg image to a lower quality jpeg can lead to bad looking pictures. The disadvantage of this format is that it does not support tranparency but you can use as background color for your images, the same color that you used for background in your web site. Of course jpeg is supported by all browsers.
Portable Network Graphics (.png): PNG begun as a GIF alternative that is not licensed. PNG’s advantage against GIF is the 24-bit color depth support and against jpeg the transparency support. That could make you think that PNG is the best format to save images for the web, but I have to mention something here: PNG is not supported by older browsers (like Internet Explorer 5.5). There are two PNG types: png 8-bit and png 24-bit. The 8-bit png is the same as GIF but with 30% smaller files. The 24-bit png is suitable for every type of image but the output files are larger than jpeg because it uses loseless compression (like GIF). PNG-24 supports up to 256 transparency levels.