本文介绍了php imagecopyresampled质量差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP脚本保存原始图像,然后调整大小 - 一个缩略图和一个较大的图像供Web查看。除了一些图像质量很差外,这种方法效果很好。它似乎是用非常低的颜色托盘保存的。您可以在(我假设你用于最终输出):

You can raise the quality using the third parameter to imagejpeg() (which I assume you are using for the final output):

imagejpeg  ( $new_image, null, 99);

在90-100范围内玩游戏。文件大小将比原始图像大 - 这将是您支付的价格。但是应该可以达到相当的质量。

Play around in the 90-100 range. The image will become larger in file size than the original - that is going to be the price you pay. But it should be possible to achieve comparable quality.

或者,正如John Himmelman在评论中已经说过的那样,尝试使用 imagepng()为了更好的质量 - 当然还要以明显更大的文件大小为代价。

Alternatively, as John Himmelman already says in the comments, try using imagepng() for better quality - also at the price of a notably larger file size, of course.

这篇关于php imagecopyresampled质量差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:47
查看更多