[Gimp-user] Extracting images from a PDF



If the PDF file contains a JPEG image that was encoded at 200dpi
(say),
and you open the PDF in GIMP at 300dpi, GIMP will use a library to
render the PDF to a bitmap image at 300dpi, so that library will take
the 200dpi embedded image, render it to a bitmap, and then enlarge it
(artifacts of compression and all), probably using a simple linear or
cubic interpolation.

This means that every pixel in the image GIMP sees will be an average
of the actual pixel values around it in the original.

What you want to do is to extract the original 200dpi (in this
example)
image and then have GIMP open that, not lose the quality by changing
the size first.

There's no easy way to know the resolution of the embedded images; in
some cases ImageMagick's "identify" command will list them, and e.g.
https://superuser.com/questions/193485/extract-images-in-pdf-without-affecting-the-resolution
links to a simple program to extract the actual JPEG images from PDF
without reencoding them -
https://www.perlmonks.org/?node_id=720495

If you just need to rotate them, you can then use e.g. jpegtran, which
is lossless.

Also note the free version of Acrobat also changes the sizes of the
images by resampling.

slave liam (ankh on IRC)


I'm not too concerned about the techincal side as long as it does the job
I am not an expert Just to clear up this is  method that gets me very good
results and works on any PDF ...Import PDF as images at a height of approx 5000
px individual pages then export as PNG that size gives plenty of room to crop
and still save at reasonably good high end quality .. Keep It Simply So ...

-- 
fa-flyingalone (via www.gimpusers.com/forums)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]