I want to take a image (a brush) and draw it into a displayed image. I only want to affect the alpha of that image, and I need to export it later.
From what I’ve seen, most directions only really get into some costly looking operations that don’t pan out. ie they recommend you draw into an offscreen context, create a CGImage of the mask, and create a CGImageWithMask pretty much every time the brush is applied at all.
I already know this is costly because even just doing this and drawing into a context is rather rough for iPhone.
What I’d like to do is take the UIImage of an UIImageView, and manipulate it’s alpha channel directly. I also am not doing it pixel-by-pixel, but with a largish (20px radius) brush that has a softness of its own.
I would not use an UIImageView for this. A normal UIView is enough.
Just put the Image into the layer with
after that you can make parts of the image transparent by adding a mask to the layer
for a project I did something where I had a brush.png that you could use to reveal an image with a finger… my update mask function there was: