MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / recolor

Method recolor

src/__init__.py:6300–6311  ·  view source on GitHub ↗

Change the color component count on all pages. Args: components: (int) desired color component count, one of 1, 3, 4. Invokes the same-named method for all pages.

(self, components=1)

Source from the content-addressed store, hash-verified

6298 mupdf.pdf_rewrite_images(pdf, opts)
6299
6300 def recolor(self, components=1):
6301 """Change the color component count on all pages.
6302
6303 Args:
6304 components: (int) desired color component count, one of 1, 3, 4.
6305
6306 Invokes the same-named method for all pages.
6307 """
6308 if not self.is_pdf:
6309 raise ValueError("is no PDF")
6310 for i in range(self.page_count):
6311 self.load_page(i).recolor(components)
6312
6313 def resolve_names(self):
6314 """Convert the PDF's destination names into a Python dict.

Callers 1

rewrite_imagesMethod · 0.95

Calls 2

load_pageMethod · 0.95
recolorMethod · 0.45

Tested by

no test coverage detected