SyntaxFix
Write A Post
Hire A Developer
Questions
Or if you want to count white or black pixels
This is also a solution:
from PIL import Image import operator img = Image.open("your_file.png").convert('1') black, white = img.getcolors() print black[0] print white[0]