Created
November 15, 2013 04:25
-
-
Save matthewpoer/7479060 to your computer and use it in GitHub Desktop.
Script to take a few input png files (e.g. 25x40 named blue_Marker.png) and create 0-99 annotations for them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$colors = array('blue','green','grey','navy','orange','purple','red','yellow'); | |
foreach($colors as $color){ | |
echo $color; | |
$text = "[foodbank {$color} blank]"; | |
$root_file = $color.'_Marker.png'; | |
for($i=00;$i<100;$i++){ | |
echo $i; | |
$num = strval($i); | |
if(strlen($num) == 1){ | |
$size = '8,18'; | |
}else{ | |
$size = '3,18'; | |
} | |
$new_file = $color.'_Marker'.$i.'.png'; | |
system("cp {$root_file} {$new_file}"); | |
system("mogrify -draw \"text {$size} '{$num}'\" -fill white -font Verdana-Bold -pointsize 14 {$new_file}"); | |
} | |
echo "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment