You can create the context of the desired size using UIGraphicsBeginImageContext(), then draw the image in the context using the UIImage method -drawInRect:and finally use UIGraphicsGetImageFromCurrentImageContext()to pull out the new UIImage.
source
share