ImageMagick stack diagram

Source: Internet
Author: User
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.