0
我需要將一些命令行imagick代碼轉換爲php類。我不能在我們的生產箱上運行命令行腳本,所以我需要能夠使用這些類,遺憾的是沒有關於在兩者之間轉換的文檔。PHP GD或Imagick class Image Magick Conversion
有誰知道我該如何使用imagick類來做到這一點?
$color_mask ="convert -size $dimensions xc:#$color -fill white";
/* create the silver mask */
$silver_mask ="convert -size $dimensions xc:#e6e7e8 -fill white";
/* resize the image to the $larger_dim before cropping it to the dimensions to get that "zoomed in" effect */
$thumb = "convert images/$im -thumbnail $larger_dim^ ".
" -gravity center -extent $dimensions PNG:-";
/* screen the resized thumbnail and the color mask */
$masked = "convert $thumb $color_mask -compose Screen -gravity center -composite PNG:-";
/* multiply the masked thumb with the silver mask */
$final = "convert $masked $silver_mask -compose Multiply -gravity center -composite PNG:-";
/* Output the image*/
header("Content-Type: image/png");
passthru($final, $retval);
我也很樂意在GD中做同樣的事情,我剛剛在GD中獲得了質量權利方面的問題。
TIA