How do you convert an image to black and white in PHP

Using the php gd library:

imagefilter($im, IMG_FILTER_GRAYSCALE);
imagefilter($im, IMG_FILTER_CONTRAST, -100);

Check the user comments in the link above for more examples.

Leave a Comment