
Extracting images from Apps in the AppStore - admp
http://idevrecipes.com/2010/12/06/extracting-images-from-apps-in-the-appstore/
======
recoiledsnake
Does he mean optimize or obfuscate?

~~~
allenbrunson
He really does mean 'optimize'.

There is a command-line utility that is run during Xcode app builds called
'pngcrush'. It was originally written by somebody else, then modified a bit
for Apple's use. It tries to further compress png files and, I think,
reorganizes them so that they can be more efficiently rendered by the iPhone's
GPU. Like, maybe so they can be drawn bottom-to-top, rather than the usual
top-to-bottom? I read about this once, but it was years ago, and I can't
remember all the details.

~~~
robterrell
It reorders the bytes of the image from RGBA to BGRA, which is the natural
byte order used by the GPU (other byte orders are supported, but have to get
swapped when loaded). Also, it premultiplies each color channel by the alpha
channel. So if you have a blue pixel with a 50% alpha (RGBA 00 00 FF 80) it
gets converted to (BGRA 80 00 00 80). After that, it uses the usual pngcrush
method of trying all different compression settings until it finds the
smallest size. So it's optimized both in terms of size and speed of rendering.

