On Thursday 20 August 2009 10:53:13 Appolloni, Thomas wrote: > > Of course, I decided to take it a step further and perform texture > > conversions > > > as well. I wanted to convert the .dds texture files to .jpg. This > > code is > > > stubbed in; however, it does not work. I thought I could simply call > > osgDB::writeImageFile. Unfortunately, the individual image format > > writer > > > plugins do not appear to handle converting from different pixel > > formats or > > > packing. Does OSG contain code for converting osg::Image between > > different > > > pixel formats? Am I missing an easier option? > > > > Thanks, > > Justin > > Justin, > > I didn't see any additional traffic on this thread. Were you able to get > a > solution to this image conversion problem. I'm now facing a similar > situation > with the .dds image node from generated osgdem tiles and want to convert > > those images into .jpg or other formats. > > Regards, > Tom
Tom, It has been a while since I looked into this. I did not find a solution in OSG, and the problem was not important enough to warrant spending more time on it. If I had to revisit this problem today, I would look into using Boost.GIL (Generic Image Library) for the conversion. http://www.boost.org/doc/libs/1_39_0/libs/gil/doc/index.html GIL is a header-only library that allows you to generically convert between different pixel and packing formats. With this library, you could convert an osg::Image object containing .dds data into an osg::Image object containing .jpg data. Alternately, you could create a Boost.GIL image using the .dds osg::Image data and use Boost.GIL I/O to output the Boost.GIL image as a .jpg file. Hopefully, someone can chime in with a simple solution. Respectfully, Justin _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

