Better quality image from UIGraphicsGetImageFromCurrentImageContext()
core-graphics, ios, objective-c
Solution
Instead of using `UIGraphicsBeginImageContext` you should be using:
UIGraphicsBeginImageContextWithOptions(size, NO, 0);
Problem
I'm currently using UIGraphicsGetImageFromCurrentImageContext() to save a content's image to a user's camera roll, but the image quality is worse than if I do a screen shot in the simulator. Is there any way to improve it? And what format the saved image is in anyway? Bmp? Is there any way to change this? Here's my save code: ``` CGSize size = [content bounds].size; UIGraphicsBeginImageContext(size); [[content layer] renderInContext:UIGraphicsGetCurrentContext()]; UIImage *originalImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(originalImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); ```