Colorizing and swapping colors with PHP GD Image Library?

后端 未结 1 1720

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

相关标签:
1条回答
  • 2021-01-14 00:07

    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);
    ?>
    
    0 讨论(0)
提交回复
热议问题