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

Problem rotating 32-bit png with alpha channel


I can do this using OpenCV to load the image file and then the WarpAffine function from the ipp_blur_rotate_sample SDK sample; the alpha channel from the original image is preserved however areas in the new rotated image that were not originally present default to 100% opacity which is not what I want. I would like them to default to transparency but cant see how to do this easily without extra processing ( subsequently I am using ippiAlphaComp_8u_AC4R to composite the rotated image with larger video frames and don't want to them obscure parts of the video ).

I can work round this by my making my images larger and then when compositing specifying a smaller ROI which gets all the important content but doesn't include the opaque new regions but this is not ideal since it requires extra calculation.

- I found out this morning its simply a question of setting the border value argument iWarpAffineLinearInit(...) to a value which has the alpha channel set to zero

0 Kudos
1 Reply

Hi Tim,

Thanks for letting us know the "trick" to achieving the targeted opacity in rotation. Thanks! 

0 Kudos