PHP - Imagick - 调整大小后质量不佳

I have got this image (900x900, .jpg) - http://imgur.com/J1HArLS

I resized it to 290x290 and i got this - http://imgur.com/bZFyhxD

This is my PHP code :

$thumb_large = new \Imagick($path);
$thumb_large->setImageFormat( 'jpeg' );
$thumb_large->setResolution(900,900);
$thumb_large->setImageCompression(\Imagick::COMPRESSION_JPEG);
$thumb_large->setImageCompressionQuality(100);
$thumb_large->adaptiveResizeImage($value[0], $value[1]);
$thumb_large->writeImage(public_path() . '/uploads/images/'.$key.'/' . $file_name);

What am i doing wrong? The quality is horrible.

dtcwehta624485
dtcwehta624485 简单:阅读文档:php.net/manual/en/imagick.thumbnailimage.php
4 年多之前 回复
drnf593779
drnf593779 我该怎么用?
4 年多之前 回复
dongyan7950
dongyan7950 只是好奇...为什么不使用$imagick->thumbnailImage?
4 年多之前 回复

1个回答




质量太差了。</ p>
</ blockquote>

来自 手册:</ p>

“自适应调整大小 具有数据依赖性三角测量的图像。避免在明显的颜色变化中模糊。当用于将图像略微缩小到略小的“网页大小”时最有用;当将全尺寸图像自适应地调整为缩略图时,可能看起来不太好 </ strong>。“</ p>

我建议使用 http :/ phpgick :: FILTER_LANCZOS </ p>
</ div>

展开原文

原文

The quality is horrible.

From the manual:

"Adaptively resize image with data-dependent triangulation. Avoids blurring across sharp color changes. Most useful when used to shrink images slightly to a slightly smaller "web size"; may not look good when a full-sized image is adaptively resized to a thumbnail."

I suggest using http://php.net/manual/en/imagick.resizeimage.php with \Imagick::FILTER_LANCZOS

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐