MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / color_count

Method color_count

src/__init__.py:13575–13583  ·  view source on GitHub ↗

Return count of each color.

(self, colors=0, clip=None)

Source from the content-addressed store, hash-verified

13573 JM_clear_pixmap_rect_with_value(self.this, value, JM_irect_from_py(bbox))
13574
13575 def color_count(self, colors=0, clip=None):
13576 '''
13577 Return count of each color.
13578 '''
13579 pm = self.this
13580 rc = JM_color_count( pm, clip)
13581 if not colors:
13582 return len( rc)
13583 return rc
13584
13585 def color_topusage(self, clip=None):
13586 """Return most frequent color and its usage ratio."""

Callers 3

color_topusageMethod · 0.95
test_color_countFunction · 0.95
test_4336Function · 0.95

Calls 1

JM_color_countFunction · 0.85

Tested by 2

test_color_countFunction · 0.76
test_4336Function · 0.76