Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Shane_W_
Beginner
75 Views

Optimized RGB and RGBA Compositing

Is there anything in the IPP that will accomplish using the Alpha channel of RGBA image to overlay the RGB components onto an RGB image or to a new image?  I've taken a look at the ippiAlphaComp() functions, but they do not seem to allow mixing of C4R and C3R.

Basically looking for this:

SourceB = RGB image

SourceO = RGBA image

SourceB = (SourceO x SourceO) + (SourceB x (255 - SourceO))
SourceB = (SourceO x SourceO) + (SourceB x (255 - SourceO))
SourceB = (SourceO x SourceO) + (SourceB x (255 - SourceO))

 

0 Kudos
2 Replies
Igor_A_Intel
Employee
75 Views

Hi Shane,

yes, mixing in this case doesn't work. Possible way is to convert C3 image to AC4 (ippiCopy_8u_C3AC4R), fill A channel with "1" and then use ippAlphaOver function that applies aA*A+(1-aA)*aB*B formula. I guess it will be too expensive from the performance point of view and it's better to use the simple loop in your code.

regards, Igor

Shane_W_
Beginner
75 Views

I ended up asking a similar question on stackoverflow, here is the link that will hopefully aid someone else.

http://stackoverflow.com/questions/22018826/implement-a-near-real-time-cpu-capability-like-glalphafu...

Reply