Instantly share code, notes, and snippets.

Embed
What would you like to do?
let correctedImage = ciBikeImage
.cropped(to: box_rect)
.applyingFilter("CIColorInvert")
.applyingFilter("CIPerspectiveCorrection", parameters: [
"inputTopLeft": CIVector(cgPoint: topLeft),
"inputTopRight": CIVector(cgPoint: topRight),
"inputBottomLeft": CIVector(cgPoint: bottomLeft),
"inputBottomRight": CIVector(cgPoint: bottomRight)
])
.applyingFilter("CIColorControls", parameters: [
kCIInputSaturationKey: 0,
kCIInputContrastKey: 32
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment