PHP-Image - Using GD in PHP (Help!)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
refined
Forum Newbie
Posts: 1
Joined: Fri Jan 04, 2008 5:08 pm

PHP-Image - Using GD in PHP (Help!)

Post by refined »

I have an image, greyscale.

I want to convert everything that is *NOT* white to black.

How can I do this? Is there such a function that exists to convert a greyscale image to 100% black or 100% white ?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I was certain there was a function in hte GD library which did just that...but I cannot find it so perhaps it was from another library...

Anyways, still do-able...just more work:

imagesetpixel
imagecolorat

Just converting everything *not* white to black will not convert a greyscale image to black and white...well it will...but the image will likely be skewed...
Post Reply