ipad - extract images from application?

17,850

Solution 1

Yes. Find the app .ipa file in your "Music/iTunes/Mobile Applications" folder. Make a copy somewhere and rename it to a .zip file. Unzip the file. In the Payload folder, right click on the .app file and select "Show Package Contents." You can now access all of the app's resources.

PNG files will be encoded for the iPhone and need to be converted to be viewable on your Mac/PC. There are several utilities for this.

I've used atPeek to automate this entire process, but it isn't a free application (I think it's $5): http://www.atpurpose.com/atPeek/

Solution 2

Starting with iOS SDK 3.2 (and up) you can use pngcrush to undo the iOS PNG optimizations.

Use the command:

$ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations "~/Path/To/The/Apps.app/Image.png" "~/Path/To/Place/The/Reverted/Image.png"

See http://developer.apple.com/library/ios/#qa/qa1681/_index.html for complete info.

The iOS SDK is available for free download at: http://developer.apple.com/devcenter/ios/index.action

You can download pngcrush without downloading the iOS SDK from: http://pmt.sourceforge.net/pngcrush/

Solution 3

In the latest xcode the path is:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush

... so make sure you edit the path in pngcrush.

Also, (for noobs), if you get permission denied its because the file is not an executable yet, do chmod +x [filename]

Solution 4

Well, there's a great github project by Cédric Luthi to do this:

https://github.com/0xced/UIKit-Artwork-Extractor

It can browse and extract the iOS internal artwork as well as the artwork of any ipa file in iTunes.

Solution 5

  • Extract the contents of the ipa file (as per @TomSwift's answer)

  • I wrote this PHP cmd line script that will convert/uncrush all images in a directory. It's a cmd line script and is tested on OSX only.

Arguments:

--indir (directory containing PNGs)

--outdir (directory where converted PNGs will be placed)

--pngcrushpath [optional] (path to pngcrush, if not specified it will default to the standard)

Example Use:

php uncrush.php --indir /MyIPAs/MyApp.app/ --outdir /MyIPAs/Converted/

Script Source:

<?php
$args = getopt('', array(
    'indir:',
    'outdir:',
    'pngcrushpath::'
));
$inDir = @rtrim($args['indir'], '/');
$outDir = @rtrim($args['outdir'], '/');
$pngCrushPath = isset($args['pngcrushpath']) ? $args['pngcrushpath'] : '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush';
if(!is_dir($inDir)){
    error('INPUT DIR IS NOT VALID - DIRECTORY NOT FOUND ' . $inDir);
}
if(!is_dir($outDir) && !mkdir($outDir)){
    error('OUTPUT DIR IS NOT VALID - DIRECTORY WAS NOT FOUND AND COULD NOT BE CREATED ' . $outDir);
}
if(!is_file($pngCrushPath)){
    error('PNGCRUSH BINARY NOT FOUND');
}
$pngs = glob($inDir . '/*.png');
foreach($pngs as $png){
    msg('CONVERTING - ' . $png);
    convert($png, $outDir . '/' . basename($png));
}
msg('DONE');
exit;
function error($str){
    $f = fopen('php://stderr', 'w');
    fwrite($f, $str . "\n");
    fclose($f);
    exit;
}
function msg($str){
    $f = fopen('php://stdout', 'w');
    fwrite($f, $str . "\n");
    fclose($f);
}
function convert($inPng, $outPng){
    global $pngCrushPath;
    exec($pngCrushPath . ' -revert-iphone-optimizations -q ' . $inPng . ' ' . $outPng);
}
?>

I wrote this script for my own use today, I hope it is of use to someone else. Feel free to modify and repost elsewhere, but please link back to this answer on SO.

Share:
17,850

Related videos on Youtube

Ian Vink
Author by

Ian Vink

https://mvp.microsoft.com/en-us/PublicProfile/5002789?fullName=Ian%20Vink

Updated on May 14, 2022

Comments

  • Ian Vink
    Ian Vink 15 minutes

    is there a way to extract images from an app I downloaded?

    I can do this on Android, but iPad?

  • Saurabh Hooda
    Saurabh Hooda almost 9 years
    if you want png files just for viewing them in preview then no need to reverse optimize (or decode) the files by any tool. Just copy png file in any folder outside .ipa folder (for ex in Downloads folder) and you can see them in preview. However if you want to use PNG for any other purpose then just use pngcrush tool provided in Xcode itself. Reverse optimization (or decoding) by pngcrush will decrease the size of the image.