So I have 2 CIImage that I want to merge together, so each with an alpha of 0.5. How can I do it?
I tired the following code but the resulting image is not the correct size and the two images aren't allied correctly... Please help!
if let image = CIImage(contentsOf: imageURL) {
let randomFilter = CIFilter(name: "CIRandomGenerator")
let noiseImage = randomFilter!.outputImage!.cropped(to: (CGRect(x: CGFloat(Int.random(in: 1..<1000)), y: CGFloat(Int.random(in: 1..<1000)), width: image.extent.width, height: image.extent.height)))
let compoimg = noiseImage.composited(over: image) //Misaligned image
}