我在php中没有使用exec命令,因此无法像手册中所述那样运行以下内容:http://www.imagemagick.org/Usage/layers/。手册中指出:“您可以进一步制作整个图像数组,并通过行或列构建它们。”
convert \( font_1.gif font_2.gif font_3.gif +append \) \
\( font_4.gif font_5.gif font_6.gif +append \) \
\( font_7.gif font_8.gif font_9.gif +append \) \
\( -size 32x32 xc:none font_0.gif +append \) \
-background none -append append_array.gif
使用imagick中的http://php.net/manual/en/imagick.appendimages.php appendImages函数,如何模拟看似更强大的append CLI命令通过行和列连接图像?或者仅使用imagick中的appendImages函数无法实现?
我希望能够在php中创建以下数组,循环遍历它,并在每个新行上告诉imagick何时在合并图像之前开始新行。
$rack = [
'row1' => [
'image1.jpg',
'image2.jpg'
],
'row2' => [
'image3.jpg',
'image4.jpg'
]
];
我的问题是,如何在imagick或其他imagick函数中使用appendImages来实现与CLI convert -append命令类似的结果?
我知道我可以使用其他函数,比如compositeImage,并使用x、y来控制定位,但对于我的用例来说,简单地按行附加会更简单得多。