Count Black Pixels of Image
I 开发者_开发百科am trying to count only the black pixels of a PNG image using PHP. Have not found anything close on the web. Thanks in advance!
You can achieve that using gd. Just open the image with imageCreateFromPNG()
, get the image size with imagesx()
and imagesy()
and then loop over all pixels and do imageColorAt()
.
精彩评论