[英]How do I translate this ImageMagick command into its PHP Imagick equivalent?
我正在嘗試在ImageMagick文檔中遵循這個 “教程”,但是遇到了很多麻煩。 我想在其Imagick PHP equivelant中完成以下ImageMagic命令:
convert -virtual-pixel transparent \
\( $top -matte +distort Affine \
'0.5,511.5 0.5,0.5 0.5,0.5 -87.5,-50 511.5,511.5 87.5,-50' \) \
\( $left -matte +distort Affine \
'511.5,0.5 0.5,0.5 0.5,0.5 -87.5,-50 511.5,511.5 0.5,99.5' \) \
\( $front -matte +distort Affine \
'0.5,0.5 0.5,0.5 0.5,319.5 0.5,99.5 319.5,0.5 87.5,-50.0' \) \
-background black -layers merge +repage \
-bordercolor black -border 5x2 isometric_cube_overlap.png
其中$top = new Imagick('top.png');
, $front = new Imagick('front.png');
,和$left = new Imagick('left.png');
。 每個都是512x512px png圖像。
我發現了一些關於仿射變換的相當缺乏的文檔 ,但我不知道$matrix
應該是什么或者如何使用該函數。 我甚至嘗試在實際的ImageMagick命令上運行exec
,但什么都沒發生。 我期待轉換已經完成並保存為isometric_cube_overlap.png
。
我真的可以在這里使用一些幫助,即使有人可以指出我正確的方向。 謝謝!
當然你可以這樣運行命令嗎?
<?php
$cmd = " convert -virtual-pixel transparent \
\( $top -matte +distort Affine \
'0.5,511.5 0.5,0.5 0.5,0.5 -87.5,-50 511.5,511.5 87.5,-50' \) \
\( $left -matte +distort Affine \
'511.5,0.5 0.5,0.5 0.5,0.5 -87.5,-50 511.5,511.5 0.5,99.5' \) \
\( $front -matte +distort Affine \
'0.5,0.5 0.5,0.5 0.5,319.5 0.5,99.5 319.5,0.5 87.5,-50.0' \) \
-background black -layers merge +repage \
-bordercolor black -border 5x2 isometric_cube_overlap.png "." -distort ScaleRotateTranslate \"28,24 .4,.8 -110 50,120 \" ";
exec("$cmd");
?>
反斜杠對我來說也不合適。 我打賭那個命令的輸出也失敗了?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.