[osg-users] slow speed of osgDB::writeImageFile() for monochrome PNGs?

Christian Buchner christian.buchner at gmail.com
Mon Sep 12 02:08:11 PDT 2016


Hi, I allocate and write out an 8 bit 1024x1024 pixel map like this

osg::ref_ptr<osg::Image> img = new osg::Image;
img->allocateImage(1024, 1024, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE);
/* omitted: fill the image with science (TM) */
osgDB::writeImageFile(*img, filename);

I am a bit puzzled that writing a PNG file to disk seems to take 5 seconds
in a release build, and about twice that time in debug builds.

Using Visual Studio 2015 Express Edition and the osg-3rdparty CMAKE build
process
from here https://github.com/bjornblissing/osg-3rdparty-cmake together with
libPNG 1.6.21 (lpng1621.zip)

Any idea what might cause this extremely slow writing process? It's just a
megapixel of grayscale data. I am puzzled.

Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160912/4064c378/attachment-0002.htm>


More information about the osg-users mailing list