Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • thank you for he superb answer, much in details! when I run it with the left image, the counts returns [ 371 558 2962 7584 373 6624 16461]. the right images counts returns [ 371 232 1558 479 373 12806 19114]. their sums are the same 34933. So by that, it says they have same areas of colors? Commented Jan 6, 2020 at 6:40
  • 1
    That says they have the same area; i.e. your summation says that the number of pixels in each image is equal. I'd examine unique_colors as well, which tells you which colors have which counts. From there, you would compare the unique colors, find which colors are shared between images, and then make a comparison between the images. Commented Jan 6, 2020 at 6:45
  • great! actually I measure the white - which ever has less white = has more colored area! thanks again for the sharing and solution! Commented Jan 6, 2020 at 6:50
  • 1
    Awesome! Glad to be of help — I edited the answer to be more clear about this. Just for reference — in case you/anyone else needs it — white is represented as something like [255, 255, 255] (for 3-channel RGB). Commented Jan 6, 2020 at 6:54