tags:

views:

386

answers:

1

I just built an application in ASP.net that returns a PNG image.

The resulting image is entirely black on a transparent background. Is there a way to index the image to reduce the file size?

I can not index the new image as it is created because I am using the graphics object which will not allow it.

Thank you very much for the help - I've been searching for ages and i can't seem to figure out how to set this up.

+1  A: 

To the best of my knowledge, you can't do this using straight GDI+ - the built-in PNG encoder is very limited in its support for output color depths... Even if you manage to create an indexed Bitmap with a good palette in-memory, you'll still find it written out as a 32bpp PNG. To get the kind of control you need, you'll have to resort to a third-party image library.

See:

Shog9
Thanks! You just saved me a lot of frustration. Sorry for the slow response.
apocalypse9