Domanda

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.

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.

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

È stato utile?

Soluzione

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

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.

Altri suggerimenti

If you are interested in a new approach that reduces compressed image file size, I have created and iOS framework that compresses PNG images into a more compact form called PNGSquared. It is somewhat like the posterization approach, but you have more control over quality.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top