GD Quality Issue with Transparent PNGs

筅森魡賤 提交于 2019-12-20 07:34:39

问题


I'm getting some very bad quality using GD to resize some PNGs. If I don't resize them, it seems fine, and if I use GD's negate filter, it seems fine as well, which is very weird. But nothing else seems to help.

This is happening with timthumb (latest) and aq_resize for wordpress.

Here is one image, processed with timthumb:

http://cdn.squidix.com/images/branding/name-white.png?h=150

The original of this image is white text over a transparent background. The white text has no border, it just blurs into transparency. It will only let me post one link here, take off the ?h=150 to see the original image (you won't see it in your browser, because it's completely white, download it to see it).

But after being processed with GD, it has grainy light gray artifacts in the background, and there's now a gray border around the white text. If you're using an LCD, look up at it from an angle and you'll see how bad it is.

Update: This doesn't happen with imagecopyresized, only imagecopyresampled.

PHPInfo - http://cdn.squidix.com/

来源:https://stackoverflow.com/questions/23200823/gd-quality-issue-with-transparent-pngs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!