HTML CSS IMAGES LINKS
 
HTML → GIF vs. JPG

The two most common image file compression formats used on the internet are jpeg and gif. Another format for saving images for the internet is png or "portable network graphics," but since it is rarely used, we will concentrate on the first two.

Jpeg stands for "Joint Photographic Experts Group." A jpeg (pronounced JAY-peg) is a graphic image created by choosing from a range of compression qualities. When you create a jpeg or convert an image from another format to a jpeg, you are asked to specify the quality of image you want. Since the highest quality results in the largest file, you can make a trade-off between image quality and file size. The reason for choosing the jpeg format for images with more complex color patterns is that this format enables you to save images with millions of colors, whereas the gif option restricts you to 256 colors.

Along with the gif file format, the jpeg is a file type supported by the World Wide Web protocol, usually with the file suffix of ".jpg." You can create a progressive jpeg that is similar to an interlaced gif.

GIF stands for "graphics interchange format." It is a highly compressed graphics format that lets you download and view graphics very quickly.

Gif offers two other advantages. The first is interlacing. Interlaced images don't need to be completely downloaded before you begin to see them. Instead, they start by showing a very low-resolution sample of the image, and then gradually the image becomes sharper as more of it is downloaded. All browsers support the gif format.

Gif's second advantage is the ability to have a transparent background. This means that the background color or graphic on a page can be seen through areas of the graphic so that the image seems more like a part of the page rather than it having to sit inside a rectangular box.

As a rule of thumb, gif is best for images with few colors. For images with more colors, such as photographs, jpeg offers higher compression and smaller file sizes.



 
  back ↑