create statistics on image (e.g. mostly used color...)
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:
- Colors (nb of colors used, most used colors, even better if I can get a the name of dominant color tone)
- Shapes (whether the开发者_StackOverflow中文版 image -once background removed- is close to a square,circle,nb of basic shapes detected in image)
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.
精彩评论