This version of the page http://www.panoramio.com/blog/alpha-in-png-images/ (0.0.0.0) stored by archive.org.ua. It represents a snapshot of the page as of 2008-08-17. The original page over time could change.
Alpha in PNG images at Panoramio

Panoramio's Blog


Alpha in PNG images

March 3rd, 2006 by Joaquín Cuenca Abela

Quick trivia:

Why do some PNG images show with weird backgrounds in Explorer ≤6?

(Remember I said Explorer. If you see these images with a white background you’re seeing them with an PNG alpha capable browser, aka “anything but explorer”.)

I hope we all know by now that Explorer doesn’t render correctly PNG images with an alpha channel (ie. with transparent parts). But, if it doesn’t render them correctly, how do it render them?

It renders them against a solid color background, instead of using the content of the page as background. And what color does it use for the background? Actually the color is inside the PNG file itself, and you can choose it!

If you use, as I do, The GIMP you can check the option “Save the background color” when you save a PNG file. That option will set as “background color” the current background color in your palette (green in the image).

Carefully choosing your background color you will be able to use your PNG files with an alpha channel if you have a solid background in your page.

Explorer handles correctly the case of a 1-bit alpha channel in the PNG images (as with GIF images), so the remaining buggy case remains 8-bit alpha channel against a non solid color page. For that one you will have to resort to Explorer filters to make it work. But be careful, filters are slow, and if you have a lot of little images using filters for the alpha channel will make your page extremelly slow to load!


No Responses to “Alpha in PNG images”  

  1. No Comments

Leave a Reply


For spam detection purposes, please copy the number 7874 to the field below:

  • Archives

    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
  • Categories

    • css (2)
    • html (8)
    • Interaction Design (6)
    • javascript (11)
    • miscellaneous (25)
    • new features / improvements (63)
    • panoramio (49)
    • personal (2)
    • places (25)
    • Uncategorized (5)