How can I convert DIB or bitmap to png?

a Bitmap saved as a PNG is a PNG.
So if you have a wx.Bitmap and do something wacky as
bmp.SaveFile("someScan.png", wx.BITMAP_TYPE_PNG)
you'll end up with a png.
If you want something like optimised size of PNG you could use PIL or maybe pass the resulting images through something like pngcrush.

···

On Wed, 8 Dec 2004 15:53:05 +0100, <BSchmeil@autoscout24.com> wrote:

Hi all,

my little scanner app is almost done. I'll write down some experiences
(more related to twain module than wx / wxPython) soon and make it
available.

However, the remaining obstacle is that I don't know how to convert the
image generated by a scan, which is available as DIB file and converted
to a Bitmap for display. I've seen docs and examples on ImageHandler,
specifically PNGHandler, but it seems it can just be used to load / save
PNG files, not convert DIB / BMP to PNG.

--
Peter Damoc
jack of all trades, master of none
http://www.sigmacore.net/