Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Alphablending with global alpha?

meldaproduction
Beginner
508 Views
Hi, I'm trying to optimize some graphics processing for GUI and found that things like copying images and alphablending are very fast. However what I need is alpha composition of 2 images, where the target's alpha is not important (that I think is possible), source's alpha is used, AND also a global alpha is used to multiply the source's alpha. So:

DST = DST * (1 - SRCA * GLOBALALPHA) + SRC * (SRCA * GLOBALALPHA)

I think it is pretty basic. The source image has its own alpha (like imagine a button with round borders), but I may want the button to be not completely opaque. Is there a way to do that?

There is AlphaComp, which uses image's alpha. And there is AlphaCompC which uses predefined alpha, but I need both at once.

Cheers!
0 Kudos
7 Replies
meldaproduction
Beginner
508 Views
This reminds me - would it be possible to implement something like AlphaBlend in Windows API? I mean, IPP's implementation of simple alphablend is faster, but it would need the global alpha and possibility to resize the output, linear interpolation is just fine. I think this would be very handy for many people and save A LOT of CPU time...
0 Kudos
Ying_H_Intel
Employee
508 Views

Hello,

Thanks for let us know. I will escalte the request to our product definition database and get back to you if there are any updates.

Thanks
Ying

0 Kudos
meldaproduction
Beginner
508 Views
Thank you Ying!

Cheers!
0 Kudos
gol
Beginner
508 Views
I've been trying to get this to work for an hour, trying to find where my mistake was.. I didn't know it was simply not possible (while indeed pretty basic)
0 Kudos
Ying_H_Intel
Employee
508 Views
Hi Gol,

Could you please attach your code so we may see if there is some problem?

Best Regards,
Ying
0 Kudos
gol
Beginner
507 Views
Hi,

well there's no code, since as I read it's not supposed to be featured.

Like the OP I needed alphablending of a premultiplied source onto a target, in which both the source's own alpha channel & a global alpha are used. This is normally the most basic use for alphablending, when you wanna draw a masked image onto another.

Weirdly everything I find on the net uses the source's alpha channel, or a global alpha, but rarely both (like the GDI's AlphaBlend does).

IPP allows doing it in 2 passes, though.
0 Kudos
Ying_H_Intel
Employee
507 Views

Dear All,

Just check if the feature is still interesting?   As if it is very rare used, then we may not implement it. 

Thanks

Ying 

0 Kudos
Reply