我希望它像这样:
但是我得到了:
<?php
$image = new imagick( $_SERVER['DOCUMENT_ROOT']."/test/op.jpg" );
$points = array(
90,
);
$image->setimagebackgroundcolor("#fad888");
$image->setImageVirtualPixelMethod(\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);
$image->distortImage(\Imagick::DISTORTION_CYLINDER2PLANE, $points, true);
header("Content-Type: image/jpeg");
echo $image;
答案 0 :(得分:1)
您要使用wave filter,而不是失真滤镜。
<?php
$image = new Imagick("googlelogo_color_272x92dp.png");
$image->setImageBackgroundColor("#fad888");
$image->setImageVirtualPixelMethod(\Imagick::VIRTUALPIXELMETHOD_BACKGROUND);
$image->waveImage($image->getImageHeight() / -2, $image->getImageWidth() * 2);
header("Content-Type: image/jpg");
echo $image->getImageBlob();
您需要修剪图像以删除底部添加的多余空间。输出: