On Thu, 09 Sep 2004 17:24:43 GMT, "tjh" <t.******@ten.t sacmoc> wrote:
i'm a bit new to PHP - i've been messing around with the GD2 image functions
and was wondering:
i see a lot of information about converting a color image to grayscale but i
can't figure out how to determine whether an image (GIF or JPG) is grayscale
in the first place.
is there a way to do this in PHP?
If it's a paletted image, imagecolorsfori ndex(), or for a true colour image
loop through the pixels and usage imagecolorat().
All the colours should have their red, green and blue components equal, or
near equal, if it's a greyscale image.
--
Andy Hassall / <an**@andyh.co. uk> / <http://www.andyh.co.uk >
<http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool