Here is the background jpg:
http://www.kgcore.com/highcotton/swan/back/Swan.jpg
Here is the php file that puts a name together using append using transparent png files located in an alphabet folder.
Code: Select all
<?php
$text2 = "plus";
$bg = 'back/Swan.jpg';
$cache = 'cache/';
$ext = '.png';
$alphabet = 'alphabet/';
$final = 'final/';
$text = "amanda";
$text3 = "chris";
$text = strtolower($text);
$text3 = strtolower($text3);
$textarray = str_split($text);
$createolay1 = 'convert ';
foreach ($textarray as $t) {
$createolay1 .= $alphabet.$t.$ext.' ';
}
$createolay1 .= $alphabet.'space'.$ext.' '.$alphabet.$text2.$ext.' '.$alphabet.'space'.$ext.' ';
$textarray = str_split($text3);
foreach ($textarray as $t) {
$createolay1 .= $alphabet.$t.$ext.' ';
}
$createolay1 .= '-background none +append name'.$ext;
exec($createolay1, $result);
$olay1='name.png';
list($width, $height) = getimagesize($olay1);
while($width > 1610) {
$width--;
}
$resize = "convert -resize ".$width." name.png name.png";
exec($resize, $result);
$finalout = 'convert ".$bg." -gravity north name.png -geometry +0+360 -composite '.$final.$i.'final.pdf';
exec($finalout, $result);
exec('rm name.png');
http://www.kgcore.com/highcotton/swan/final/final.pdf
That the outside transparency stays but some of the inside of the letters has a black background ... so it's not preserving all of the transparency, just some of it.
I'm pretty sure this worked flawlessly in an older version of IM, I'm running on the latest version.
EDIT:
I commented out the rm at the end of the script so you can see the name.png
http://www.kgcore.com/highcotton/swan/name.png
So as you can see there, all transparency is there... even through it in photoshop to make sure, worked fine.