I am using the below code for convert black and white image. Its working fine. But I change the brightness and contrast of that image. App is crashed only on iOS 6.0. I am using any deprecated methods? Please help me. Change brightness and contrast using this link https://github.com/esilverberg/ios-image-filters
- (UIImage *)convertImageToGrayScale:(UIImage *)image
{
CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height);
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
CGContextRef context = CGBitmapContextCreate(nil, image.size.width, image.size.height, 8, 0, colorSpace, kCGImageAlphaNone);
CGContextDrawImage(context, imageRect, [image CGImage]);
CGImageRef imageRef = CGBitmapContextCreateImage(context);
UIImage *newImage = [UIImage imageWithCGImage:imageRef];
CGColorSpaceRelease(colorSpace);
CGContextRelease(context);
CFRelease(imageRef);
return newImage;
}
Thanks in advance.
Check the following links for the list of deprecated methods
https://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html
http://www.bgr.com/2012/07/16/ios-6-download-beta-3-change-log/
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/_index.html