开发者

How to reduce UIImage size to a maximum as possible

开发者 https://www.devze.com 2022-12-31 22:25 出处:网络
I am using following code to resize the image. Resize a UIImage Right Way And I use interpolation quality as kCGInterpolationLow.

I am using following code to resize the image.

Resize a UIImage Right Way

And I use interpolation quality as kCGInterpolationLow.

And then I use UIImageJPEGRepresentation(image,0.0) to get the NSData of that image.

Still its a little bit high in size around 100kb. when I send it over the network. Can I reduce it further. If I am to reduce it more what could I do ?

Thanks an开发者_运维问答d Kind Regards,


you image compress and image data stroed NSData format. The function is

UIImageJPEGRepresentation(UIImage * _Nonnull image, CGFloat compressionQuality);

Example:

NSData *objImgData = UIImageJPEGRepresentation(objImg,1.0);
0

精彩评论

暂无评论...
验证码 换一张
取 消