Colorizing and swapping colors with PHP GD Image Library?

一个人想着一个人 提交于 2019-12-01 07:17:36

use Blue (#0276DB) instead of orange, and then inverse the image (using IMAGE_FILTER_NEGATE) to get orange and black.

So, your code will be:

<?php
header('Content-type: image/jpeg');
$im = imagecreatefromjpeg('test.jpg');



imagefilter($im, IMG_FILTER_GRAYSCALE);
imagefilter($im, IMG_FILTER_CONTRAST, 255);
imagefilter($im, IMG_FILTER_NEGATE);
imagefilter($im, IMG_FILTER_COLORIZE, 2, 118, 219);
imagefilter($im, IMG_FILTER_NEGATE);

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