Metal Core Image Filter does not Compile

Apple Recommended

Replies

It's also worth noting that there is a built-in filter that does exactly that: CIBlendWithRedMask

Uses values from a mask image to interpolate between an image and the background. When a mask red value is 0.0, the result is the background. When the mask red value is 1.0, the result is the image.