waving android

I am currently a software engineer at Google, where as a member of the Android platform team I build frameworks and user interfaces.

The blog here at is mostly historical; you can find more recent posts on .

ds-sleight.

August 22nd, 2007

I got an email this morning asking for help with ds-sleight.js. I subsequently discovered that Google didn’t know anything about it except what other people have written. So here’s some quasi-official documentation:


ds-sleight is a small blob of JavaScript I’ve been using since the year 200X to force Internet Explorer to render the 8-bit alpha channel in 32-bit PNG images. (You might recall me whining about IE’s miserable support for PNG transparency back in 2002.)

There’s a little by way of instruction in the JavaScript source; here’s a slightly more verbose version of the installation procedure:

  1. Save a one-pixel transparent GIF (like this one) somewhere on your server (default path: /images/spacer.gif). Don’t hotlink it off dsandler.org, or I’ll hunt you down and kick your ass.
  2. Copy ds-sleight.js to your server as well.
  3. Add to any page that has a PNG with alpha:

    <script src="«path»/ds-sleight.js" type="text/javascript"></script>

It even (mostly) works on PNGs used as CSS background-images.
Enjoy (if you haven’t already)!

Add a comment

html help (show)

newer: older: