I want to implement an image downscaling algorithm for iOS. After reading that Core Images\'s CILanczosScaleTransform
was a great fit for it, I implemented it the f
You can use imageByClampingToExtent
.
Calling this method ... creates an image of infinite extent by repeating pixel colors from the edges of the original image.
You could use it like this:
...
guard let ciImage = CIImage(image: image)?.clampedToExtent() else {
fatalError("Couldn't create CIImage from image in input")
}
See more information here: Apple Doc for clampedtoextent