简体   繁体   English

PHP GD图像水印质量

[英]PHP GD Image Watermark Quality

I'am using PHP GD to copy an image (watermark) on another image.我正在使用 PHP GD 将图像(水印)复制到另一个图像上。 Unfortunately the quality of the watermark is terrible.不幸的是,水印的质量很糟糕。

I'm using quality 100% as the attribute, but it doesn't help.我使用 100% 质量作为属性,但它没有帮助。

Have you guys know any good way to increase the quality?有没有什么提高质量的好方法?

Regards.问候。

A 90% quality should give you the exact same results and decrease the file size by half (on JPEG, OFC). 90% 的质量应该给您完全相同的结果并将文件大小减少一半(在 JPEG、OFC 上)。

Try using ImageCopyResampled() instead of ImageCopyResize() , other than that I don't think you can do anything else with GD alone, maybe Imagick has some other tricks.尝试使用ImageCopyResampled()而不是ImageCopyResize() ,除此之外,我认为您无法单独使用 GD 做任何其他事情,也许 Imagick 有其他一些技巧。

Are you using any transparency, or is it just a solid square.您是否使用任何透明度,或者它只是一个实心正方形。 What exactly looks bad about the quality?质量到底有什么不好? The edges, the whole thing?边缘,整个事情?

I like to use a 24bit transparent PNG for the watermark, and imagemagick to do the overlay, you get a lot of control over the final product that way.我喜欢使用 24 位透明 PNG 作为水印,并使用 imagemagick 进行叠加,这样您就可以对最终产品进行大量控制。

Lots of possibilities for watermark with imagemagick: imagemagick 水印的很多可能性:
http://www.imagemagick.org/Usage/annotating/ http://www.imagemagick.org/Usage/annotating/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM