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.
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
Bitmapwith 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: