I'm using GPUImage framework of Brad Larson in my app and I need to make a mask of mask.jpg and photo. So mask images are two colors images with black background and white geometric figure. So basically masking is working, the problem is that I can't make the transparency of mask. To make that I need to replace the black color of mask.png to lighter color (more gray to white).
So I tried to use code from here
Want to change a particular color inside an image with another color - iPhone
But it doesn't work, the alpha is set to 0 and I don't know why. I tried to debug and everything seems to be fine, but it returns an UIImage with transparent color instead of black color.
Is there a way to make it without coregraphics. Maybe coreimage?
GPUImage masking transparency
Asked Answered
The real solution is not to replace a color but to actually use an input video that has already been split into RGB and Alpha channels. For example, see https://mcmap.net/q/1328843/-ios-overlaying-alpha-channel-video-on-another-video –
Impressionable
© 2022 - 2024 — McMap. All rights reserved.