因此,我试图覆盖一个t恤(Png)的图像,一个图案(也是png),与Imagick。
守则:
$img1 = new Imagick('test.PNG');
$img2 = new Imagick('pattern.png');
$img1->compositeImage( $img2, imagick::COMPOSITE_COPYOPACITY, 1, 1);
header('Content-type: image/png');
echo $img1;当我运行这段代码时,它确实会生成一个映像,但它的大小是模式映像(28x28)。我想用我选定的图案“填充”t恤,我对Imagick相当陌生,我被图像填充部分卡住了。,我也为改变颜色做了这个,这似乎很好!
发布于 2013-11-01 11:58:43
尝试将代码更改为
$img1->compositeImage( $img2, imagick::COMPOSITE_COPYOPACITY, 30, 30); // where 30 , 30 is the dimension of your tshirt.https://stackoverflow.com/questions/19725732
复制相似问题