Skip to content
Discussion options

You must be logged in to vote

You don't seem to need the xref at all, do you? Or any detail on how the page appearance references the image?
If I get you right, all you need are bbox coordinates of raster images actually shown on the page.

If this is true, I recommend you use text extraction - although this seems not to be obvious:
There is a performance oriented variant, which delivers text blocks of which every image is represented by a line of text with image metadata:

pprint([b for b in page.get_text("blocks") if b[-1] == 1])  # take only image blocks
[(344.25,
  88.93597412109375,
  540.0,
  175.18597412109375,
  '<image: DeviceRGB, width 261, height 115, bpc 8>',
  0,
  1)]

An image block is represented by a 1 a…

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
12 replies
@JorjMcKie
Comment options

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@JorjMcKie
Comment options

@priyamharsh14
Comment options

Answer selected by mohammadmjn
Comment options

You must be logged in to vote
2 replies
@mohammadmjn
Comment options

@JorjMcKie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #906 on February 19, 2021 08:49.