Adding one image at the bottom of another in PHP

后端 未结 3 1723
终归单人心
终归单人心 2021-01-01 07:20

I\'d like to add one image to the bottom of another in php

I\'ve this to load the images:

//load top
$top = @imagecreatefrompng($templateTop);
//load         


        
3条回答
  •  伪装坚强ぢ
    2021-01-01 08:15

    $photo_to_paste = "photo_to_paste.png";
    $white_image = "white_image.png";
    
    $im = imagecreatefrompng($white_image);
    $im2 = imagecreatefrompng($photo_to_paste);
    
    
    // Place "photo_to_paste.png" on "white_image.png"
    imagecopy($im, $im2, 20, 10, 0, 0, imagesx($im2), imagesy($im2));
    
    // Save output image.
    imagepng($im, "output.png", 0);
    

提交回复
热议问题