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

Method delete_image

src/__init__.py:10892–10903  ·  view source on GitHub ↗

Delete the image referred to by xef. Actually replaces by a small transparent Pixmap using method Page.replace_image. Args: xref: xref of the image to delete.

(page: 'Page', xref: int)

Source from the content-addressed store, hash-verified

10890 return val
10891
10892 def delete_image(page: 'Page', xref: int):
10893 """Delete the image referred to by xef.
10894
10895 Actually replaces by a small transparent Pixmap using method Page.replace_image.
10896
10897 Args:
10898 xref: xref of the image to delete.
10899 """
10900 # make a small 100% transparent pixmap (of just any dimension)
10901 pix = Pixmap(csGRAY, (0, 0, 1, 1), 1)
10902 pix.clear_with() # clear all samples bytes to 0x00
10903 page.replace_image(xref, pixmap=pix)
10904
10905 def delete_link(self, linkdict):
10906 """Delete a Link."""

Callers 1

test_delete_imageFunction · 0.80

Calls 3

clear_withMethod · 0.95
PixmapClass · 0.85
replace_imageMethod · 0.80

Tested by 1

test_delete_imageFunction · 0.64