]> git.mxchange.org Git - quix0rs-blobwars.git/blob - gfx/sprites/recolor
Import of version 1.14 minus music and sounds.
[quix0rs-blobwars.git] / gfx / sprites / recolor
1 #!/usr/bin/php
2
3 <?php
4
5         $handle=opendir(".");
6
7         if (!$handle)
8         {
9                 echo ("Invalid directory\n");
10                 exit();
11         }
12
13         while (($file = readdir($handle)) !== false)
14         {
15                 $pos = strpos($file, ".png");
16                 if ($pos !== false)
17                 {
18                         $command = sprintf("convert -colors 256 $file $file");
19                         echo "$command\n";
20                         system($command);
21                 }
22         }
23
24         closedir($handle);
25
26         echo "Done.\n";
27 ?>