Image format Usages

When it comes to website development, images plays a vital role. And making use of proper image formats is also very important. Here is explanation about which format we need to use and when.


Jpegs are for photos. I see jpegs with text in them occasionally and they just look awful. Text is best for text, otherwise use PNG.
If it's not a photo, but you want a graphic of it, use a PNG. A PNG is almost always smaller than the equivalent gif and will not lose quality like a jpg. A png equivalent of a jpg will typically be a lot larger (assuming it's photorealistic). There may be times where this is still desirable.
PNG does allow for 8-bits of transparency, but if you have to support IE, you'll find that they continually refuse to support that correctly. They do support a single bit of transparency in an 8-bit image (essentially the same as gif) as far as I know. There are also numerous hacks to get 8-bit transparency to work in IE. I've never bothered, myself.
In summary:
  • Photos → jpg
  • !Photos → png

Comments

Popular posts from this blog

CSS Equal Height Columns, Three Different Ways

The Simplest Way To Center Elements Vertically And Horizontally

User Avatar Image and User name and Email in LIferay Theme