How to change color image to Black & White image in iOS 6.0?
<p>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 <a href="https://github.com/esilverberg/ios-image-filters" rel="nofollow">https://github.com/esilverberg/ios-image-filters</a> </p>

<pre><code>- (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;
}
</code></pre>

<p>Thanks in advance.</p>
