I am displaying an image in tableview cell (Image name saved in a plist). Before setting it to the cell, I am resizing the image to
imageSize = CGSizeMake(32, 32);
But, after resizing the image, quality is also getting degraded in retina display.

I have both the images added to the project (i.e. 1x and @2x).
This is how I am reducing the image size to 32×32.
+ (UIImage *)scale:(UIImage *)image toSize:(CGSize)size
{
UIGraphicsBeginImageContext(size);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return scaledImage;
}
Any pointers on this is very much appreciated.
Thanks
try this : instead of
UIGraphicsBeginImageContext(size);useUIGraphicsBeginImageContextWithOptions(size,NO,0.0);from what i understand what you’re doing there is resizing the image to 32×32 (in points) no matter what the resolution. the
UIGraphicsBeginImageContextWithOptionsscales the image to the scale of the device’s screen..so you have the image resized to 32×32 points but the resolution is kept for retina display(note that this is what i understood from apple’s uikit reference..it may not be so..but it should)
read here