开发者

create statistics on image (e.g. mostly used color...)

开发者 https://www.devze.com 2023-01-10 10:18 出处:网络
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 st

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开发者_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.

0

精彩评论

暂无评论...
验证码 换一张
取 消