Re: [osg-users] Store rgb data into rgba image

2012-07-10 Thread Jorge D'Alpuim
Thanks a lot Ulrich! Your tips really helped me! A small mistake turned to be a huge headache but now it's all going right. Beyond your indications I just needed to change the following Code: unsigned char* rgba_data = (unsigned char*)calloc(size * 4,sizeof(unsigned char)); to Code:

[osg-users] Store rgb data into rgba image

2012-07-09 Thread Jorge D'Alpuim
Hi everyone, I am trying to dynamically convert several images from rgb to rgba however it has been very difficult to achieve my goal. I have a few rgb images with black background though what I want is to convert the black background into transparency. So far I haven't found any method that

Re: [osg-users] Store rgb data into rgba image

2012-07-09 Thread Ulrich Hertlein
On 8/07/12 3:16 , Jorge D'Alpuim wrote: int height = image_rgb-s(); int width = image_rgb-t(); int length = image_rgb-r(); const long size = width * height * length * 4; unsigned char* rgb_data = image_rgb-data(); unsigned char* rgba_data = (unsigned char*)calloc(size,sizeof(unsigned