tags:

views:

57

answers:

1

Hello,

Sorry if the question is a bit vague but I'm new to gd. I'm wondering whether gd already has some built-in methods or whether PHP classes relying on gd exist that could present me with a bunch of statistics for a given image. I'm mostly interested in:

  1. Colors (nb of colors used, most used colors, even better if I can get a the name of dominant color tone)
  2. Shapes (whether the image -once background removed- is close to a square,circle,nb of basic shapes detected in image)

Thanks

+1  A: 

Colors count: http://www.php.net/manual/en/function.imagecolorstotal.php

Color of a given pixel: http://www.php.net/manual/en/function.imagecolorat.php

As for shapes, you'd need to scan the image and apply some smart algorithms to detect that. I'd say that's not quite easy.

Marcelo
+1 for putting some links. I ended up recyling this http://valokuva.org/?p=72
That's a useful link too! (+1)
Marcelo