WebDevelopersNotes logo

home-icon Home / Graphics / JPEG file format

JPEG file format

JPEG file format

The JPEG or JPG file format was adopted quite early on the Internet. It’s name comes from Joint Photographic Experts Group, the organization that created the format. As evident from the name, JPEG images are used mainly for photographs.

The JPEG come in two flavours, a plain JPG file and a Progressive jpg. The latter are similar to Interlaced gifs wherein the image is displayed in the browser in a series of passes.

In contrast to Gifs that can have only 256 colors, JPEG images can contain 16.7 million colors (24-bit color information). Also, JPEGs do not use palettes like Gifs and cannot have transparency.

Sponsored Links

JPGs do not support animation, though you can make an animated jpg banner using a little JavaScript. Refer to Animated Jpgs tip in the Tips and Tricks section of this site for further details.

So even though you are a beginner you should know that GIFs and JPGs differ in three important ways:

  • Color Depth: Gifs can contain only 256 colors while Jpgs can contain millions of colors
  • Transparency: The JPG image format does not support transparency and transparent colors. Colors in a Gif image, on the other hand, can be made transparent.
  • Animation: Again, JPG images do not support animation while Gif image do. Animated Gifs are simply a set of images (or frames, if you like) played one after the other giving a semblance of animation.

As I mentioned above, the JPG image format is more suited for photographs while the Gif is ideal for line drawings and images with areas of flat color. before we go deeper into this, let me give you a sneak peek.
Below are two images saved in the JPG and GIF file formats. Note the file size difference and the quality.

JPG images
A photograph saved in the JPG image file format
File size: 6314 bytes
Image with areas of flat colors saved as a JPG
File size: 3777 bytes
GIF images
A photograph saved as a GIF
File size: 12137 bytes
Image with areas of flat colors saved in the Gif file format
File size: 1019 bytes

To know more on when to correctly use jpg and gif file formats or how to optimize very well the image display on a web page (Using GIF and JPG in a single image?), please refer to separate articles. You can also take a look at When to use Gifs and When to use JPGs.

JPGs can be created using any of the standard image editing and manipulation programs available. These software also let you control the compression levels (which we’ll discuss very shortly) in Optimizing JPGs.

For the Internet, the resolution of JPGs should be reduced to 72 dpi, since this is the maximum resolution most monitors have. JPEG images usually carry .jpg extension; though rare, you might also come across the .jpeg file extension.

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

During the second quarter of 2010, Kindle ebook sales outnumbered those of hardcode books. [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy