hyd*_*d00 10 objective-c uiimage uiimagejpegrepresentation ios uiimagepngrepresentation
我正在使用UIImagePNGRepresentation保存图像.结果图像的大小为30+ KB,在我的情况下这是大的.
我尝试使用UIImageJPEGRepresentation它,它允许压缩图像,所以图像保存在<5KB大小,这是伟大的,但保存为JPEG给它白色背景,我不想要(我的图像是圆形的,所以我需要保存它透明背景).
如何压缩图像大小UIImagePNGRepresentation?
PNG 使用无损压缩,这就是 UIImagePNGRepresentation 不像 UIImageJPEGRepresentation 那样接受compressionQuality参数的原因。使用不同的工具,您可能会得到更小的 PNG 文件,但与 JPEG 不同。
| 归档时间: |
|
| 查看次数: |
6233 次 |
| 最近记录: |