ROY
ROY

Reputation: 91

How to reduce image size captured from cam

The Picture taken from the iphone cam is nearly 2.5 Mb, How to reduce this size ,I have tried UIJPEGRepresentation(image,0.1f),but it does not effect the size ?

Upvotes: 1

Views: 2168

Answers (2)

rckoenes
rckoenes

Reputation: 69469

You really can't reduce the size the images takes up in memory.

When an image is loaded, basically a UIImage object the size wil be width x height x 4 bytes. That is the size the an uncompressed image will take up in memory. Since you can use compressed images all image, once loaded in a UIImage will be uncompressed.

If you really need so save some memory, save the image to disk and create a thumbnail which you use in your app. Then when need you can load the larger image and use it,

Upvotes: 1

Meet
Meet

Reputation: 4934

Try using the Resize method in UIImage+Resize.h

https://github.com/AliSoftware/UIImage-Resize


 [aImgView setImage:[ImageObjectFromPicker resizedImageWithContentMode:UIViewContentModeScaleAspectFit bounds:YourSize interpolationQuality:kCGInterpolationHigh]];

Upvotes: 0

Related Questions