I want to reduce image file size that take from UIImagePickerController
. I use this method
NSData *imageData = UIImageJPEGRepresentation(image, 0.1);
but it reduce 2.2 MB image file size to 300 KB I want my image file size become less than 100 KB.
First resize the image with below method:
call this by:
And finally compressed your image as required:
Easiest way to reduce image size in kilos is to reduce the size in pixels! Scale it smaller:
Apple's docs state:
And since the compression quality is a CGFloat, it supports decimal places beyond the tenths place. That being said, try: