Hello, I am trying to colorize and change colors on an image using the GD image library with PHP.
I am using the original image located here: http://korlon.com/youknowbetter/test.jpg
And I want to bring it to the point where it is an orange face with black clothes and hair, as you see here: http://youknowdifferent.org/
So far I have used the following code:
<?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, 252, 137, 36); imagejpeg($im); ?>
To close it, but I still do not have the ability to turn all white shades into black shades. http://korlon.com/youknowbetter/filter.php
I tried replacing white with black as indicated in this question: Can I change colors in an image using the GD library in PHP?
However, this does not work. In fact, it does not change color. Is it because I use jpg and not gif? Is there something I need to do with the color palette?
Thanks, any help would be greatly appreciated!
STOOB
source share