[英]Image Color Change After Watermark Apply in PHP
Developed Watermark Script,but on adding water mark the image color changes. 开发了水印脚本,但是添加水印后图像的颜色会发生变化。
// merge the source image and the watermark
imagecopy($image, $watermark, $watermark_pos_x, $watermark_pos_y, 0, 0, imagesx($watermark), imagesy($watermark));
Change Image color after Watermark. 在水印之后更改图像颜色。
Since you are already using GD
functions, just apply a filter to your image: 由于您已经在使用GD
功能,因此只需对图像应用滤镜即可:
imagefilter($img, IMG_FILTER_GRAYSCALE);
Check the documentation: http://php.net/manual/en/function.imagefilter.php 检查文档: http : //php.net/manual/zh/function.imagefilter.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.