Ok I have a working solution using transformations. To be perfectly honest I don't 100% understand what I'm doing with the color matrices - so the way I did this may be less than optimal. Code pasted below in case anyone else runs in to the same problem.
Basically the transformation makes the transparent pixels black and the colored pixels white. I then used MakeTransparent on the white pixels. There should be a way to do this in a single step but it is beyond me today unfortunately
Thanks again chris- I had been searching for hours to find a technique that would work and I hadn't come across anything on this type of transformation.
<%@ page language="vb" contenttype="image/png" %>
<%@ Import Namespace="System.IO" %>
<%@ import namespace="system.drawing" %>
<%@ import namespace="system.drawing.imaging" %>
<%@ import namespace="system.drawing.drawing2d" %>
<script runat="server">
Sub Page_Load()
Dim tmpImage As Bitmap = Bitmap.FromFile(Server.MapPath("test.png"))
Dim input As Bitmap = New Bitmap(tmpImage.Width, tmpImage.Height, PixelFormat.Format32bppArgb)
Dim trans As New ColorMatrix(New Single()() _
{New Single() {0, 1, 1, 1, 0}, _
New Single() {1, 0, 1, 1, 0}, _
New Single() {1, 1, 0, 1, 0}, _
New Single() {1, 1, 1, 1, 0}, _
New Single() {0, 0, 0,255, 1}})
Dim attr As New ImageAttributes
Dim rc As New Rectangle(0, 0, input.Width, input.Height)
Dim out As New memorystream
Dim g As Graphics = Graphics.FromImage(input)
g.Clear(Color.Transparent)
attr.SetColorMatrix(trans, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Bitmap)
g.DrawImage(tmpImage, rc, 0, 0, input.Width, input.Height, GraphicsUnit.Pixel, attr)
input.makeTransparent(System.Drawing.Color.White)
input.Save(out, ImageFormat.Png)
g.Dispose()
input.Dispose()
tmpImage.Dispose()
out.WriteTo(Response.OutputStream)
End Sub
</script>