Primary Navigation
Tips and Tricks
PNG is an extensible file format for the lossless, portable, well-compressed storage of raster images.
Browser compatability is a huge issue with the masses who strive for " Web Standards", especially when we you hear css and xhtml.
Something we tend to over look is the benefit of various graphic formats, expecially my favorite, PNG (Portable Network Graphics).
The w3c defines the 1996 approved mime type as png and describes what it is as follows:
PNG is an extensible file format for the lossless, portable, and well-compressed storage of raster images. PNG provides a patent-free replacement for GIF and can also replace many common uses of TIFF. Indexed-color, grayscale, and truecolor images are supported. Plus an optional alpha channel for transparency. Sample depths range from 1 to 16 bits per component (up to 48bit images for RGB, or 64bit for RGBA).
Due to the poor support for in IE6 (Internet Explorer 6), most web designers avoid "pngs" and try to get the risk takers to join their safety first band wagon (you know who you are). The sense of safety they feel is enough to convince them that the benefits of this wonderful file type are not worth investigating. However, since the release of IE7 we now see the impending demise of IE6. Hopefully soon we will see a huge comeback for png's.
For the png fans out there, take solace in " The Return of the PNG"
Thanks to plixid.com for the inspiration.
Recent Contributors
Recently Discussed
- Image Replacement Techniques + Search Engines = Love
6 weeks ago - Fonts Part 1: Keeping it in the Family
2 months ago - The Return of the PNG!
2 months ago
Recent Posts
- Sorry, You’re Not My File Type
3 days ago - Imagery Part 2: It's All a Blur...
11 days ago - Web Mechanics Need Good Tools
3 weeks ago - Format Images Using the IGLOO Editor
3 weeks ago - The Basics: Editor Tips
3 weeks ago
Page Options
Guest
1 Comment
PNG is a really nice format to use while roughing in the design and CSS of a site. First, chop up your layout into 64-bit lossless PNG images, and build your CSS and HTML so everything looks pixel-perfect. The page size will be huge, but that's not an immediate concern. When all the design work is done, you'll optimize all those sliced up PNGs - some will be converted to JPG, others may become a smaller 32-bit or 16-bit PNG, or GIF - depending on its palette, transparency needs, etc. Some may even be discarded entirely, visually replaced by CSS techniques.
There are techniques using PNG that, if used intelligently, will save bandwidth - potentially lots of it! For instance, you can reuse PNG opaque-to-transparent gradients layering them over solid colors, to produce color gradients. If your design uses a lot of gradients as backgrounds with complex foregrounds, using PNG layering will prevent the use of images with large blocks of gradated colors (which are normally can not be compressed very well) behind foreground elements (which can be placed over the gradient as a separate layer, potentially with a much smaller palette size and antialiased transparency).
Images that are going to be shown over different background colors are a perfect fit for PNG. If you employ antialiasing in the alpha channel, your icon will never have that "jagged white halo"
The only true advantage of PNG is its alpha channel. I'm all for using PNG where it's appropriate, but alas designers who use PNG compulsively can get lazy about optimization (speaking from personal experience) and end up with huge 64-bit images consuming bandwidth where 64-bit images aren't needed. Using PNG is like cooking with salt. Use it sparingly where it's needed to enhance a flavour, but don't put it on everything. Some people put salt on everything. Yuck!
GIF has transparency too - selected pixels can be colored "see-through". In contrast, PNG can do has partial opacity - any pixel can be colored and semi-transparent. Adding an alpha (opacity) channel theoretically increases the file size by 1/3 (increasing from 3 channels to 4 is an increase of 33%). Choose your compression format conservatively - do you need opacity, or do you only need transparency?