Skip to content
Discussion options

You must be logged in to vote

Page 0 contains 4 images with masks, where each image and its mask have different resolutions.
PyMuPDF does not support this.

In [1]: import fitz
In [2]: doc=fitz.open("zf1.pdf")
In [3]: page=doc[0]
In [4]: page.get_images()
Out[4]:
[(28, 29, 2, 2, 1, 'Indexed', '', 'Image28', ''),
 (39, 40, 2, 2, 1, 'Indexed', '', 'Image39', ''),
 (41, 42, 2, 2, 1, 'Indexed', '', 'Image41', ''),
 (43, 44, 2, 2, 1, 'Indexed', '', 'Image43', '')]
In [5]: print(doc.xref_object(28)) # base image
<<
  /Type /XObject
  /Subtype /Image
  /Width 2  # <===
  /Height 2 # <===
  /ColorSpace [ /Indexed /DeviceRGB 1 <FF0000FFFFFF> ]
  /BitsPerComponent 1
  /Interpolate false
  /SMask 29 0 R
  /Length 2
>>
In [6]: print(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ericosmic
Comment options

Answer selected by ericosmic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug not a bug / user error / unable to reproduce
2 participants
Converted from issue

This discussion was converted from issue #2491 on June 25, 2023 09:00.