I need to take a BMP that I have in memory (stored as an HBITMAP or a CImage take your pick), and save it to a PNG file on disk.
Here is how I am currently saving the image as a png. CImage img; img.Save("foo.png")
My problem is that is far too slow (250ms for ~1920X1080). This takes 3X the time of saving as JPG, and about 9X the time of saving as a BMP.
I know there are a lot of g++ libraries for linux (e.g. libpng) that will do this, but most of the libraries that support visual studio only support version 6, and I haven't found one with benchmarks, so I'm kind of hesitant to try getting these libraries working only to find out they are too slow.
I am not sure what type of encoder windows uses (it's hidden in a DLL), but there must be a faster one (I'm even willing to sacrifice a bit of disk size, up to twice as much).
Java libraries do this very quickly, but for some reason Microsoft's library is slow as a turtle.
So I was wondering what options I have for saving screen-sizes PNGs to disk in ~100ms?