[英]How to merge two images using gd php
我有一幅图像的x,y坐标,角度,比例,宽度和高度,并且我需要在另一幅图像上放置该图像,请告诉我该怎么做!
//below code, makes an image transparent and fill in color
$img = imagecreatefrompng($this->rootFolder.'/'.$this->file);
//Convert image to grey scale and set its contrast
imagefilter($img, IMG_FILTER_GRAYSCALE);
imagefilter($img, IMG_FILTER_CONTRAST, -1000);
//make an image transparent
$white = imagecolorallocate($img, 255, 255, 255);
imagecolortransparent($img, $white);
$r = 1;$g = 1;$b = 1;
//fill respective colors in image
imagefilter($img, IMG_FILTER_COLORIZE, $r,$g,$b);
//save image
imagepng($img,$this->rootFolder.'/flex_'.$colour.'_'.$imageName.'.png');
imagedestroy($img)
//now above image has to be placed over another image provided x,y,scale,angle,width and height
请提出建议!
使div显示两个图像的位置。
然后制作一个canvas ..并从html2canvas JavaScript ..复制div到canvas中。
并制作画布图像。
您可以使用imagecopymerge()函数来完成
签出此页面: http : //php.net/manual/en/function.imagecopymerge.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.