PNG-8 with alpha transparency

April 30th, 2009

I learned a new web trick today.

Appar­ently, Photoshop's inabil­ity to save PNG-8 with alpha trans­parency is not a lim­i­ta­tion of PNG-8 but a lim­i­ta­tion in Photoshop.

For years, I have been oper­at­ing under the assump­tion that I need to use PNG-24 to achieve trans­parency effects in my web projects. This is usu­ally a com­pro­mise in terms of file size and browser com­pat­i­bil­ity (requir­ing ie-specific hacks). But it doesn't have to be…

[Enter Fire­works]

Fire­works to the rescue:

  • Open your big Photoshop-exported PNG-24 with nice alpha trans­parency in Fireworks.
  • Change the file for­mat to PNG-8.
  • Change the trans­parency option to "alpha transparency"
  • Rebuild and export your PNG-8
  • Revel in the MUCH smaller file size

Bonus points for ie6 compatibility!

Learned this from Brenelz's screen­cast which was linked on Net­Tuts

Share:
  • Facebook
  • Twitter
  • Reddit
  • Digg
  • Tumblr
  • LinkedIn
  • MySpace
  • del.icio.us
  • Google Bookmarks

5 Responses to “PNG-8 with alpha transparency”

  1. Jeff Harmon says:

    PNG-8 per­mits only a 2-bit trans­parency chan­nel, mean­ing either it's trans­par­ent or opaque, period. PNG-24 per­mits an 8-bit trans­parency chan­nel, with smooth gra­di­ents. They are not equiv­a­lent, and PNG-8 will only have pos­i­tive visual results with sharp edges.

  2. Jeff Harmon says:

    PS, Pho­to­shop han­dles all of this perfectly.

  3. Jeff Harmon says:

    I was wrong. Pho­to­shop doesn't per­mit PNG-8 to have a 2-bit chan­nel as it should, at least in CS3. Not sure if they fixed it in CS4.

    Inter­est­ing post here:

    http://www.brenelz.com/blog/2009/01/27/png-8-alpha-transparency-screencast/

  4. Facebook User says:

    Hey Jeff,

    That is actu­ally where I learned this from. I had cred­ited brenelz at the end of my post.

    Hope this is fixed in CS4

  5. Jeff Harmon says:

    Both in CS3 10.0.1 and CS4 11.0.1 I get the option of sav­ing trans­parency with PNG-8. I am now offi­cially con­fused… Yes, it is 1-bit trans­parency, but that makes sense, since it's a reduced bit-depth ver­sion of PNG. Oh wait, I see, Fire­works plays with the details of the spec better!

    http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/

    http://en.wikipedia.org/wiki/Portable_Network_Graphics#Ancillary_chunks

    (Sorry I was so reac­tive and mis­spoke about 2-bit vs. 1-bit; the only place where you were off is that PNG-8 does sup­port 1-bit trans­parency in Photoshop)

Leave a Reply