Hi there,

I have two problems in drawing PNG image using imageio on Mac OS X.

One problem is that 16-bit grayscale textures (PNG images) cannot be loaded due 
to the following errors:

<Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer 
bits/component; 16 bits/pixel; 1-component colorspace; kCGImageAlphaLast; 512 
bytes/row. 
<Error>: CGContextDrawImage: invalid context

The cause of this is that CGBitmapContextCreate doesn't accept the combination 
of 1 component colorspace and 16bps. One solution I can think of at this moment 
is to create a bitmap context using RGBA colorspace (as the same as the 32bit 
RGBA image). This works fine on FlightGear but I'm not so sure if this works on 
all 16bpp images.


Another problem is that imageio's libpng doesn't properly handle transparency 
in PNG file. The problem I have is that the transparency in PNG files are not 
at all handled and we see a lot of unexpected black or dark portions.  I 
strongly recommend the use of osgdb_png.so (or .dylib) for handling png images 
instead of imageio.

More detail explanation, screenshots, and an experimental patch for solving 
these two problems are available from:
http://macflightgear.sourceforge.net/home/development-notes/devnote-nov-26-2009 
Please try my patch and see if it also works on many OSG applications.

FYI, I'm using OSG/svn as of a few day back on Mac OS 10.5.8 / intel.

Best,

Tat

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to