当前位置:编程学习 > php >>

php用exec调用imagemagick处理图片圆角

<?php
/**php用exec调用imagemagick将图片处理成圆角**/
    $file = "zzzyk.com.png";
    $new = "yizuotu.net.png";
    $cmd = " $file \( +clone -alpha extract \\
    \( -size 15x15 xc:black -draw 'fill white circle 15,15 15,0' -write mpr:arc +delete \) \\
    \( mpr:arc \) -gravity northwest -composite \\
    \( mpr:arc -flip \) -gravity southwest -composite \\
    \( mpr:arc -flop \) -gravity northeast -composite \\
    \( mpr:arc -rotate 180 \) -gravity southeast -composite \) \\
    -alpha off -compose CopyOpacity -composite ";

    exec("/usr/local/imagemagick/bin/convert $cmd $new;");

亲测代码无误


CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,