Converting PNG files

Posted: September 26, 2013

I've read several reasons why you can't just take a png file out of the iOS firmware and open it in your favorite image editing program: there's additional data in the file that makes it unrecognizable, the color channels are skewed, the images are compressed by removing metadata. It's my understanding the pngs are modified like this to make it easier/quicker for the iPhone to process and render them, or just to befuddle people who would mess around with the iOS system files.





This image was removed from my iPhone. I noticed that you can see what the image looks like based on the icon. If you try to view stock graphic files in the firmware, you'll see they refuse to display with image editing programs like Adobe Photoshop. I did notice that the Apple Preview program was able to open it, but that's not a very helpful program for what we want to do.

iPhone


I will be using a program called pngcrush, which is a part of Xcode.



Step 1.

Install Xcode. Xcode will take some time to download and install. It's 1.96 gigabytes!

iPhone



Once you have installed the program from the the App Store, launch the Xcode.app in your /Applications folder to complete the installation process.



Step 2.

In order to get to the pngcrush program we need to be able to view the contents of the Xcode.app. Right click the app to do this.

iPhone



Now go to Contents//Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/   You'll see the pngcrush binary here. Either copy it someplace easier to remember or just remember the path to it to use in the Terminal later. I placed a copy on the Desktop.

iPhone




Step 3.

Go to your /Applications/Utilities directory. You'll find a program called Terminal.app. Launch it. Change directories to wherever you decided to place pngcrush. I placed a copy on the Desktop along with the graphic I wanted to convert. The command you use to convert a graphic is:

./pngcrush -revert-iphone-optimizations -q GraphicYouWantToConvert.png TheNameYouWantToGiveTheNewGraphic.png


iPhone



Here it is, a completely editable image. You do not need to do anything fancy to put this graphic back onto the iPhone, other than making sure it stays in .png format, retains the same dimensions and has transparency if it did originally.

iPhone







Return to top of page