Home

How to Choose a Web Image Format for Your HTML5 and CSS3 Based Web Pages

|
|  Updated:  
2016-03-26 13:17:20
HTML5 and CSS3 All-in-One For Dummies
Explore Book
Buy On Amazon

With so many different web image format options available for your HTML5 and CSS3 web pages, it may seem overwhelming. But, choosing an image format is easy because each format has its own advantages and disadvantages. Take a look to find out which format is best for you:

  • GIF is best when you need transparency or animation. Avoid using GIF on photos, as you won't get optimal compression, and you'll lose color data.

  • JPG is most useful for photographic images, which are best suited for the JPG compression technique. However, keep in mind that JPG isn't suitable for images that require transparency. Text in JPG images tends to become difficult to read because of the lossy compression technique.

  • PNG is useful in most situations. Older browsers may have trouble with this format.

  • SVG is useful for images which need to be re-sized without a loss of image quality or when the image is relatively simple.

  • BMP and other formats should be avoided entirely. Although you can make other formats work in certain circumstances, there's no good reason to use any other image formats most of the time.

About This Article

This article is from the book: 

About the book author:

Andy Harris earned a degree in Special Education from Indiana University/Purdue University–Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.
Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.
Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.
Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.
Andy welcomes comments and suggestions about his books. He can be reached at [email protected].