压缩PNG以与CIFilter一起使用 [英] Compressing a PNG for use with CIFilter

查看:110
本文介绍了压缩PNG以与CIFilter一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,它使用CIFilter CIHardLightBlendMode在XIB创建的视图上覆盖图像.视图是1000x1000像素,我想保持该大小直到最后.如果存在任何复杂性,这会使图像文件的png大小约为1 MB.

I have an iPhone app that overlays an image over a view created by a XIB, using CIFilter CIHardLightBlendMode. The view is 1000x1000 pixels, and I want to maintain that size until the end. This makes the image files about 1 MB as a png, if there is any complexity.

我尝试使用JPG,但是它不会将图像叠加到设备的视图上(在模拟器上有效).我曾尝试压缩PNG,但是当它们覆盖在视图上时它们会出现乱码(在覆盖之前,它们看上去与高质量的PNG相同).此外,当XCode将PNG重新压缩为特殊的iOS版本时,节省的压缩大小也将丢失.

I've tried using JPGs, but it doesn't overlay the image onto the view on a device (it works on the simulator). I've tried compressing the PNGs, but they get garbled when they get overlaid over the view (they look identical to the full quality ones until they are overlaid). Also, when XCode re-compresses the PNGs to the special iOS version, the compression size savings are lost.

我真的很想压缩文件,但是我不确定CIFilter是否可以使用.有提示吗?

I really would like to compress the files somewhat, but I'm not sure what will work with CIFilter. Any tips?

推荐答案

感谢本文-

Thanks to this article - Clever PNG Optimization Techniques - I found a trick that reduced the file size.

Posterization将文件大小从1.3 MB减少到458 KB(XCode优化后为326 KB!).这是一笔巨大的节省.我的照片(纹理)可能会大量后期处理,因此我不确定在其他情况下效果是否会很好.

Posterization reduced the file size from 1.3 MB to 458 KB (and 326 KB after XCode optimization!). This is a huge savings. My photos (textures) can be heavily posterized, so I'm not sure that this will work quite as well in other situations.

这篇关于压缩PNG以与CIFilter一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆