How to Black and White Image in PHP not just grey scale, thank you for consideration i hope you could help me!
Asked
Active
Viewed 174 times
-4
-
IMG_FILTER_GRAYSCALE: Converts the image into grayscale. ? – NullPoiиteя Jul 10 '13 at 09:02
-
Theres a similar question here. http://stackoverflow.com/questions/254388/how-do-you-convert-an-image-to-black-and-white-in-php – Sajuna Fernando Jul 10 '13 at 09:06
-
i cant understand the code in that link – Albert Jul 10 '13 at 09:30
2 Answers
0
Try using the imagefilter()
function, first with IMG_FILTER_GRAYSCALE
to make it grayscale, then with IMG_FILTER_CONTRAST
to make it full black and white.

Jesbus
- 790
- 8
- 24
0
Use imagefilter
function.
Go see it
From PHP documentation:
IMG_FILTER_COLORIZE: Like IMG_FILTER_GRAYSCALE, except you can specify the color. Use arg1, arg2 and arg3 in the form of red, green, blue and arg4 for the alpha channel. The range for each color is 0 to 255.
Use the arguments to adjust your black and white.
P.S. When asking questions in the future, please add more details and what have you achieved so far.

Mariyan
- 664
- 6
- 20