UIImage screenshot loses its quality

ios, iphone, objective-c, uiimage, xcode

Solution

Try using the withOptions version of UIGraphicsBeginImageContext

UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);

Problem

I am merging two images and then I take a screenshot by applying this code: ``` UIGraphicsBeginImageContext(size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); img_AddText=viewImage; [dragView removeFromSuperview]; imgV_SelectedImg.image=nil; imgV_SelectedImg.image=img_AddText; UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); ``` The problem is that when the final image loses its quality it blurs.

Original source