Despite of using the same ciImage for texture and image, on the result the texture has smaller height. Is there anything I'm missing in this code?
var filter: CIFilter?
switch style {
case "gaussian":
filter = CIFilter(name: "CIGaussianBlur")
filter?.setValue(radius, forKey: kCIInputRadiusKey)
case "motion":
filter = CIFilter(name: "CIMotionBlur")
filter?.setValue(radius, forKey: kCIInputRadiusKey)
case "glass":
filter = CIFilter(name: "CIGlassDistortion")
filter?.setValue(radius * 100, forKey: kCIInputScaleKey)
filter?.setValue(ciImage, forKey: "inputTexture")
filter?.setValue(CIVector(x: ciImage.extent.size.width, y: ciImage.extent.size.height), forKey: kCIInputCenterKey)
default:
return
}
filter?.setValue(ciImage, forKey: kCIInputImageKey)
guard let outputImage = filter?.outputImage else { return }

Some
CIFilters return images with greaterextentthan the input image, likeCIGaussianBlurorCIGlassDistortion.But you can crop the output back to the same
extentas the input, so that they will match again: