Why PDF image extractors return the stored picture, not the one visible on the page
A developer found that pdfimages, PyMuPDF, pdf.js and ImgIng all returned the stored pixels of an image, ignoring rotation, mirroring and clipping applied on the page. The tools did apply a palette /Decode inversion, which suggests they handle instructions attached to the image object but not those in the page's content stream. A second test, one image object painted four times under different clip shapes, supported returning the object itself, since the visible portion would otherwise differ per placement. Visible-part extraction would also require a chosen resolution and, for non-rectangular clips, an alpha channel, while PyMuPDF's clip bounding boxes gave inaccurate coverage estimates for triangles and circles. The author notes this explanation is an inference from observed behaviour rather than documented tool design.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in