Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you use Core Image filters to adjust contrast or sharpness?

How do you adjust contrast or sharpness using the Core Image framework? Which filters should be used and why?

Are there any examples which show how to do this?

like image 336
totocaster Avatar asked Oct 14 '11 15:10

totocaster


1 Answers

Contrast is easy:

CIFilter * controlsFilter = [CIFilter filterWithName:@"CIColorControls"];
[controlsFilter setValue:myImage forKey:kCIInputImageKey];
[controlsFilter setValue:@(1.5) forKey:@"inputContrast"];//and so on
displayImage = controlsFilter.outputImage; //and do a conversion from CIImage

However, for sharpness, you're out of luck, as that's not included in the filters for iOS 5.0.

like image 182
akaru Avatar answered Oct 17 '22 00:10

akaru