I have a script that uploads a picture and resizes it, which all works fine, but I wanted to be able to strip the color out of the image leaving it black and white (various shades of grey essentially). I wasn’t sure of how to achieve this?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try something along these lines:
Notice that I have shamelessly ripped this snippet from this article, which I found using a google search with the terms: php convert image to grayscale
[ edit ]
And from the comments, if you use PHP5, you could also use: