/ Published in: Objective C
Core Image provides a lot of filter to apply to images. Here there is a snippet to modify the size of the image using the Lanczos algorithm. You have to give the image URL and the ratio of the scale. If the ratio is smaller than 1 it reduce, otherwise it enlarges the image.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Resize the image CIImage *ciImage = [CIImage imageWithContentsOfURL:<#ImageURL#>]; CIFilter *scaleFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"]; [scaleFilter setValue:ciImage forKey:@"inputImage"]; CIImage *finalImage = [scaleFilter valueForKey:@"outputImage"];
URL: http://goo.gl/dBxSF