Khalsa Labs

Extracting PNG images from a file

Want to extract multiple PNG images from a file?

No need to extract images one by one using HEX Editors. Now you can extract all PNG images from a files into one folder using the following PHP script.


<form enctype="multipart/form-data" method="POST">
File: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
//script by


$f = file_get_contents($_FILES[uploaded][tmp_name],"ab");

$count = preg_match_all( '|x89x50x4Ex47.*?ENDxAEx42x60x82|s' , $f, $pngc);
echo $count;


for($i=0; $i<$count; $i++)
preg_match_all( '|x89x50x4Ex47.*?IENDxAEx42x60x82|s' , $f, $pngc);

//saves <number>.png in 'img' directory. eg: 58.png

For example, Skin files of Opera Mini S60 (skin-hqvga-multi.rsc, skin-hvga-multi.rsc, skin-qvga-multi.rsc) contains PNG images. You can see HEX codes of those images using HEX Editors like HxD – Hex Editor.

But with this PHP script, you can upload the file containing PNG images and get all PNG images in “img” directory.

Download the php script file and upload it to your Php WebServer to use it.

[button url=”” size=”medium” textcolor=”#ffffff”]Download[/button]

The following two tabs change content below.


Latest posts by MadGuyyy (see all)

want to comment ??

Your email address will not be published. Required fields are marked *