How to use ImageMagick library to realize the function of imagecopyresampled in GD library? The two pictures stacked together, read English documents to see vomit, to find a shortcut, even tell a method name I study, thank you!
Reply to discussion (solution)
Open File $imga = "Phpcn_logo.gif"; $imgB = "Phpchina.gif"; $sourceImg = Imagecreatefromgif ($imgA); $targetImg = Imagecreatefromgif ($imgB);//Get file size $sourcesize = getimagesize ($imgA); $targetSize = getimagesize ($imgB);// Merged picture imagecopyresized ($TARGETIMG, $sourceImg, 0, 0, 0, 0, $targetSize [0], $targetSize [1], $sourceSize [0], $sourceSize [1] );//Save result = Imagegif ($TARGETIMG, "c.gif"), if ($r) { echo "success";} else{ echo "Failure";}
Open File $imga = "Phpcn_logo.gif"; $imgB = "Phpchina.gif"; $sourceImg = Imagecreatefromgif ($imgA); $targetImg = Imagecreatefromgif ($imgB);//Get file size $sourcesize = getimagesize ($imgA); $targetSize = getimagesize ($imgB);// Merged picture imagecopyresized ($TARGETIMG, $sourceImg, 0, 0, 0, 0, $targetSize [0], $targetSize [1], $sourceSize [0], $sourceSize [1] );//Save result = Imagegif ($TARGETIMG, "c.gif"), if ($r) { echo "success";} else{ echo "Failure";}
Do not GD library, this I have achieved, because the speed is too slow, want to change ImageMagick
has been implemented, the document to see vomit, paste code nothing to say
$image = new Imagick (' 05.png '); $imagepng = new Imagick (' 16.png '); $imagepng->setimageformat ("png"); $image Compositeimage ($imagepng, $imagepng->getimagecompose (), 0, 0), $imagepng->destroy (); Header ("Content-type: Image/png "); echo $image; $image->destroy ();
Use Imagick directly.
$cmd = sprintf ("composite-gravity%s-geometry%s-dissolve%s '%s '%s ',%s '", ' Southeast ', ' +10+10 ', ' 16.png ', ' 05.png ', ' 05.png ');
Use Imagick directly.
$cmd = sprintf ("composite-gravity%s-geometry%s-dissolve%s '%s '%s ',%s '", ' Southeast ', ' +10+10 ', ' 16.png ', ' 05.png ', ' 05.png ');
Thank you, I want to direct output, directly with the shell do not know is not feasible, in the future may be migrated to IIS, or extended insurance some