Hello I am in the process of trying to colorize and swap colors on an image using GD image library with PHP.
I am using an original image located here: http://korlon
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);
?>