GIF vs JPEG
Both these image formats were devleoped to reduce the size of image files. As we know image files are the main reason for increased download times. GIF was the first format developed whcih reduced file size by discarding non-web safe colors. The result was a significant reduction in file size. However, photographs saved in GIF looked washed out. To adress this issue JPEG was developed. JPEG acheived reduction in file size by compressing the image using mathematical formulas. The result was even smaller file sizes. However, every time an image is save it loses some of its quality and sharpness.
Tpday we use GIF to save image fileswith limted number of colors. We JPEG to save photographs so tat we can preserve all the shades of color in the photograph.