How to compress image to a target size (not CGSize) like 10MB to 9MB?
Do I have to resize the image?
Tried UIImageJPEGRepresentation
, not very useful.
Asked
Active
Viewed 354 times
0

Meniny
- 660
- 8
- 22
-
Check out this answer http://stackoverflow.com/questions/29137488/how-do-i-resize-the-uiimage-to-reduce-upload-image-size – Jitendra Modi Dec 21 '16 at 09:42
-
Possible duplicate of [How do I resize the UIImage to reduce upload image size](https://stackoverflow.com/questions/29137488/how-do-i-resize-the-uiimage-to-reduce-upload-image-size) – Graham Sep 27 '17 at 20:59
1 Answers
0
To decrease image size, you must decrease its size or Quality. for quality you can use UIImageJPEGRepresentation
with quality in second parameter.
to downscale you can use code from this link: http://stackoverflow.com/questions/29137488/how-do-i-resize-the-uiimage-to-reduce-upload-image-size

Graham
- 7,431
- 18
- 59
- 84

PlusInfosys
- 3,416
- 1
- 19
- 33