Monday 21 April 2008

IMAGES IN WEB PAGES – When to use GIF, JPEG or PNG

There are three image formats widely used in web pages: GIF, JPEG and PNG. You need to choose the right format for your website images so that they will look good and still be a reasonable size.

Remember that web pages need to be about 70k or less (images and all) so that your pages download fast – this keeps your site visitors from falling asleep.

Points to remember:
JPEG
Use JPEG to save photographs.
JPEG cannot have transparent backgrounds.
JPEG is not good at preserving exact colors – don’t use them for logos or text.

GIF
Use GIF to save images that have sharp lines (like text) and solid colors.

Examples:
A solid red square
A typical corporate logo
Use GIF to save images that need to have a transparent background.
GIF was invented for creating screen graphics – don’t use GIF for images that you want to print on paper because they will look crappy.

PNG
Use PNG if you want to have images with blended (fades smoothly), transparent backgrounds.
Use PNG if you need to create print ready high-resolution graphics.

THEORY AND COMMENTS

ABOUT JPEG
Having plenty of time to spare because they were unable to get any dates, a bunch a nerd-photographers invented the JPEG – a method of compressing/packaging photographs in a digital format. JPEG is able to compress images by dumping unneeded image information – this makes JPEG a ‘lossy’ image format.

Because of this, with each generation that an image is saved as a JPEG, the quality gets lower since image information is getting lost with each cycle. As the quality of the image drops (information lost), the image starts to look worse and worse.
Don’t get me wrong; JPEG is still a great format for photographic images (widely used in high-end digital cameras like the Canon Digital Rebel,) you just need to know how to use them properly.

ABOUT GIF
GIF was designed for screen graphics in the day when modems were really slow. As such, they are very limited and can only support up to 256 colors.

GIF has a very simple one-color transparency, or as some people would describe it: an ‘on/off’ type of transparency. But, they are small in size and do a great job with images that have sharp lines … as I listed above.

ABOUT PNG
PNG was designed with the web in mind and is (by far) the most flexible graphic format ready for web use. The only problem is, that images saved as PNG always seem to be larger than their GIF or JPEG counter part. As such, most web designers just use GIF or JPEG.

PNG can do nifty things like contain gamma-correction information that automatically corrects the brightness of an image in different operating systems.

PNG has that smooth transparency I mentioned – graphic designers would recognize this as a 16 bit alpha channel. What that means, is that every pixel in a PNG can be semi-opaque to whatever degree you want.

PNG images come out larger because graphic design programs (Photoshop, Corel Photo Paint et cetera) are actually doing a bad job in creating PNG images. Maybe one day, they will get their act together and we can then all take advantage of PNG

17 comments:

Payroll Services said...

This is really Awesome.I was happy by seeing this blog which is all aboutWeb Design and to develop web pages to improve their website.I think the most effective and popular format for web design would be GIF and JPEG which will give the look for your photographs created on yuor web page.

Anonymous said...
This comment has been removed by the author.
Unknown said...

I had been using images for quite a long time but I wasn't very clear about which extension to use when...your post has made it much clear. Kelli

VJ_M said...

Well this is an awesome post that i have seen here.Although its not about website development which i was looking for.
But honestly its awesome.Thanks for sharing.

soman said...

Hi

Nice post. This question is always arrived that which image format is best for design a website. I think you solve our some queries.

thanks

Anu said...

Hi Friend,
Congratulations for this nice looking blog.In this post everything about Web Design Accessibility have meaningful information that would be better for others who are interested in web Design.
I am also interested in latest news, sometimes i posted on
Web Design India

Rakesh Raushan said...

I would love to spend more time on each mockup for the client but this often proves expensive in time & budget terms - eating in the time to actually develop the website.

Pen & Paper mockups and finding out exactly what the client whats before doing any mockup are quick and easy ways to find out prehand what the client wants to ensure that when you do your mockup - it is exactly what the client wants.

Rakesh Raushan said...

H K Digital Online is one of the well known corporations which provides Website Design, Website Design Delhi and also Provides SEO Services Delhi, SEO optimizing in all over India. So for more detail contact “ http://www.hkdigitalonline.com ” H K Digital Online

Unknown said...

This is great and Awesome to find really nice information about web design and development to improve their websites. you can get more information about web designing and development,
http://www.cyberdesignz.com/

Krishna Lekshmi said...

Really stunning stuff. Your blog looks very nice.

Regards,
SBL Graphics
SBL Outsourcing - Web design

XoMash said...

Very well written, I myself wasn't very sure about the differences and the usage of these extensions. It can give a crisp clean touch to the website, with high downloading speed.

Looking forward for more!

Web Design Quote.

Anonymous said...

very nice post


web design India

Anonymous said...

Great post! A good guide when including images in you website design

Sara said...

Over all a very good article, and I'll be looking forward for an article describing how can we make out website standout from our competitors.
Web Design Company

adrin said...

This is exactly what I really want to find out. And the post about images when to use in website really giving me the great ideas.

Web hosting India

Lalchand Khatri said...

This is really interesting very good article, if this is your new blog then really you working is appreciative keep it continue hard working...Thank you
Web Design Toronto

Unknown said...

It's a really nice information, I think that it's a Professional web design realted blogs. it's a nice format of picture..