Skip to main content
GameDev.net gamedev.net
🔒 Locked

DevIL and FreeImage horribly slow at saving PNG files

Started by soconne Mar 30, 2009 at 11:29 PM 1 replies 2.5k views
Original Post
soconne
soconne

ILuint image;
ilGenImages(1, ℑ);
ilBindImage(image);
ilTexImage(width, height, 1, 4, IL_RGBA, IL_BYTE, pixels);
ilEnable(IL_FILE_OVERWRITE);	
ilSave(IL_PNG, "output.png");
ilDeleteImages(1, ℑ);

The code above for some reason takes 6s to execute for a 2800 x 3400 image. It only takes 300ms to load the same sized image from disk. But to save it, takes forever using both DevIL and FreeImage. I've tried the same thing in C# and it takes 1.3s to save to disk. Anybody know what's going on? I noticed the resulting PNG file size is 6MB, whereas the original input image was around 760KB.
Author Freeworld3Dhttp://www.freeworld3d.org
PinguinDude
PinguinDude
It probably has to do with the compression type you're passing over to DevIL. PNG Is a compressed image format.
http://sourceforge.net/projects/pingux/ <-- you know you wanna see my 2D Engine which supports DirectX and OpenGL or insert your renderer here :)
Physics
Physics
It's probably slow for both libraries, because they use libpng. I'll see if there's anything I can do to speed it up in DevIL.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.