Home » Design Practice » Web Graphics Guide - Image File Formats

Web Graphics Guide - Image File Formats

Skill level:

Difficulty - 1/5


Time Required:

Time Required Icon hrs mins


Images provide a visually stimulating medium to enhance a user's experience. So mastering file formats is a critical and foundational knowledge to exceptional web design.


The currency to web graphics are image quality and file size. The dilemma is between preserving image quality to keep images clean while having a smaller file size to save bandwidth/decrease load time. Luckily, the web only require us to deal with the following three formats:



GIF - Graphics Interchange Format



  • allows up to 256 colours

  • can be animated

  • features transparencies

  • uses a lossless compression (no loss in image quality)


GIF graphics have a 256 color restrictions making it ideal for simple graphics and texts that don't require a lot of colours. Cartoons, logos, charts, and texts all work very well as GIF formats. Photo's don't. Simply put, the fewer colours you use, the more efficient GIF files are.


Here are some examples of good uses and poor uses of GIF files:


Good:



Bad:




JPG - Joint Photographic Experts Group (a.k.a. JPEG)



  • supports true colours (16 million colours)
  • allows variable compression (i.e. it has a "quality" setting with most graphic softwares)
  • suffers generational degradation if edited and saved multiple times
  • uses a lossy compression (image quality is lost reduced at higher compression)

JPGs is a great format for displaying high quality images, at small file sizes. It is most suitable when displaying images with many colours such as photographs, gradients and scanned artwork. These files tend to look poor on images that uses few colours when saved at a higher compression (see example below). Since JPG uses a lossy compression, unnecessary data are discarded during the compression process and changes are irreversible.


Good:



Bad:



PNG - Portable Network Graphics



  • allows 8, 24, or 32 byte storage (256 colours, true colours, or true coloursl+alpha transparencies respectively)

  • transparencies not supported by IE6 and file type not supported in older browsers

  • lossless or lossy compression

  • can be suitable for editing


Designed as GIF's successsor, PNG's meet the best of both worlds. Like GIFs, it supports transparencies, while similar to JPGs, it allows images to display in true color. Because PNG's can be lossy or lossless, it is not only suitable for display and distribution but is also great for editing. The only downside is that PNG's have poor support in older browsers.


Good:






Conclusion


As a final note, most image editing softwares have a feature that allows you to compare different image settings and preview these images when exporting (e.g. File > Export Preview / File > Save for Web). This is an excellent way to find the optimal setting for your images. As a general rule of thumb, set the compression to where the decrease in quality is invisible to the naked eye (for
about 20% of the original file size or less!)


Hope you enjoyed this tutorial and feel free to leave any questions or comments.


John

By John

I am the developer for tu-torial.com so I hope you find this site helpful. My background is in Fine Arts and I am currently working as a front-end developer for the University of British Columbia. Feel free to connect with me on Twitter.


Enjoyed this post?

Get more by subscribing to our RSS Feeds or follow us on Twitter!
Not sure why you should? Here's 8 Reasons to Subscribe!


Similar Posts

Web Graphics Guide - Image File Formats


There are 5 comments
Vikas Gaikwad said on March 01, 2010 - 20:40
gravatar

Nice...

Great tutorial.

Monster said on January 25, 2010 - 02:18
gravatar

Good nice Excellent Thanks man

Maxi said on December 07, 2009 - 13:58
gravatar

very goood tut man good job

ranjit said on July 29, 2009 - 09:47
gravatar

Thanks... Nice tutorial,,,

huwaw69 said on April 24, 2009 - 06:13
gravatar

Good explanation of all the needed picture formats in web designing in... keep up the good work buddy!

Leave a Comment




Press CTRL to Browse all tutorials!

Browse All Tutorials