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

What is Alpha Channal?

gunacse
Beginner
872 Views

Hi folks

i have some query about alpha channal.

1. What is Alpha Channal?

2. How did u get the Alpha channal from 24 bit image?

3. How did u display the Alpha chanal image using Ippi?

4. How did u transparent two image(one is normal image 24 bit and another one is 32 bit alpha channal image).

Thanks and Regards
Guna
0 Kudos
4 Replies
tld
Beginner
872 Views
1.
The alpha channel specifies per-pixel transparancy. In the 8bit case, if a pixel has an alpha channel value of 255, it is completely opaque. If the alpha channel is 0 it is completely transparant (invisible)

2.
A 24 bit image only has 3 channels (3 * 8 bits): Red, green and blue (RGB). Thus, there is no alphachannel in a 24 bit image... Images with alpha channels are 32bit per sample (4 * 8bits): Red, green, blue and alpha (RGBA)

3.
Im not sure I understand the question?... As such, you cannot display an image using IPP, you can, however, isolate the alpha channel in a single-channel image. Take a look at the ippiCopy function.

4.
If I understand you correctly, you need to overlay an image WITH alpha channel ontop of an image WITHOUT alpha channel...
I am not sure that there are IPP functions for this purpose, but its relatively easy to write your own function for this...
Lets call the 24 bit image im1 and the 32bit image im2... The resulting "blended" 24 bit image is res. You can overlay im1 and im2 by doing the following foreach pixel:

// Blend red channel
int r = im1[0] * im2[3] + im2[0] * (255 - im2[3]);

// Blend green channel
int g = im1[1] * im2[3] + im2[1] * (255 - im2[3]);

// Blend blue channel
int b = im1[2] * im2[3] + im2[2] * (255 - im2[3]);

// Scale values to 0-255
res[0] = r >> 8;
res[1] = g >> 8;
res[2] = b >> 8;



Kind Regards
Thomas Lund Dideriksen

0 Kudos
gunacse
Beginner
872 Views

hi

how can i get 32 bit image from 24 it image or how can i convert 24 bit image to 32 bit image. 32 bit image means 4 channal? i used ippiconvert and ippiscale ippi function it does not work. can u help me..

Thanks
Guna
0 Kudos
tld
Beginner
872 Views
You should probably take a look at ippiCopy... it will do the trick.

Copy R, G, and B channels to the 4 channel image (maybe this requires 3 separate calls to ippiCopy?).
0 Kudos
Vladimir_Dudnik
Employee
872 Views

there are functions which can copy pixel-interleaved 3 channel image to pixel-interleaved 4-channel image and vice versa with one call.

IPPAPI( IppStatus, ippiCopy_8u_AC4C3R,
( const Ipp8u* pSrc, int srcStep,
Ipp8u* pDst, int dstStep, IppiSize roiSize ))
IPPAPI( IppStatus, ippiCopy_8u_C3AC4R,
( const Ipp8u* pSrc, int srcStep,
Ipp8u* pDst, int dstStep, IppiSize roiSize ))

Regards,
Vladimir

0 Kudos
Reply