Witam,
poszukuje sposobu, abym mógł wygenerować obrazek z tekstem. Abym mógł go edytować w photoshopie.
Dużo już grzebałem, ale ciągle generuje mi obrazki jedno warstwowe.
<?php require_once('E:\xampp\htdocs\photoshop\PHPImageWorkshop\ImageWorkshop.php'); $document = ImageWorkshop::initFromPath('./file.png'); $firLayer1 = ImageWorkshop::initFromPath('./file.png'); $firLayer2 = ImageWorkshop::initFromPath('./file.png'); // Here, we clone both fir layers to use them for a second group (step 3) $firLayer3 = clone $firLayer1; $firLayer4 = clone $firLayer2; // We resize the second tree which must be smaller than the first $firLayer2->resizeInPercent(65, 65); // We initialize group which will contains 2 firs $firGroup1 = ImageWorkshop::initVirginLayer($firLayer1->getWidth() + $firLayer2->getWidth(), $firLayer1->getHeight()); // We add the 2 trees at different position in the group $firGroup1->addLayer(1, $firLayer1); // We want a height of 409px for the group $firGroup1->resizeInPixel(null, 409, true); // We add the group at the left bottom of our card $document->addLayer(1, $firGroup1, -105, -10, 'LB'); // ALL THE FOLLOWING CODE WILL BE PLACE HERE // Showing the christmas card $image = $document->getResult("ffffff"); imagepng($image,"file1.png"); // imagejpeg($image,"file1.jpg"); ?>
$filename = "card.png"; $createFolders = true; $backgroundColor = null; // transparent, only for PNG (otherwise it will be white if set null) $imageQuality = 95; // useless for GIF, usefull for PNG and JPEG (0 to 100%) $document->save('E:\xampp\htdocs\photoshop', "file3.png", $createFolders, $backgroundColor, $imageQuality);