douyong4842 2016-03-31 18:45
浏览 201

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.

  • 写回答

1条回答 默认 最新

  • doushan5245 2016-04-01 00:47
    关注

    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

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置