Using pdfimages -all
on a .pdf file, each page of which is text, I'm getting 3 images for each page in the pdf:
Foo-001-000.jp2
Foo-001-002.png
Foo-001-002.jb2e
The first file is mostly blank, but contains some ghostly background plus an occasional piece of text. The second file is black and white and appears to be some kind of mask, perhaps identifying where the text in the third file is located (?) The third file I am not able to view in Ubuntu's image viewer or gimp.
If I use -png
I similarly get three images, but all are .png's. Most (almost all) of the pdf's text in in the third image.
pdfimages -list
looks like this:
page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
1 0 image 829 1254 rgb 3 8 jpx yes 3659 0 150 150 76.2K 2.5%
1 1 image 829 1254 rgb 3 8 image yes 3663 0 150 150 5250B 0.2%
1 2 mask 1658 2508 - 1 1 image yes 3663 0 300 300 5250B 1.0%
2 3 image 934 1254 rgb 3 8 jpx yes 11 0 150 150 85.6K 2.5%
2 4 image 934 1254 rgb 3 8 image yes 15 0 150 150 14.1K 0.4%
2 5 mask 1868 2508 - 1 1 image yes 15 0 300 300 14.1K 2.5%
3 6 image 858 1243 rgb 3 8 jpx yes 47 0 150 150 78.0K 2.5%
3 7 image 858 1243 rgb 3 8 image yes 51 0 150 150 7681B 0.2%
Could someone help me understand what I've got here, and how I might combine these three images to get a single images for each page. Or equivalently, just extract single images per page. They key issue for me is to keep as much information as is available in these images. I want to avoid degradation in quality.
pdfimages
was an attempt to preserve as much as possible. (Subsidiary goal is to understand what I'm looking at with these 3 images per page. What? Why?)