Nico Schlömer
Nico Schlömer

Reputation: 58791

Extract image data from EPS

I have an encapsulated PostScript file which appears to only wrap an image file.

Is there a tool to extract the image data from it?

Upvotes: 5

Views: 4586

Answers (2)

Mark Setchell
Mark Setchell

Reputation: 207465

ImageMagick can do that:

convert file.eps file.jpg

or you can do

convert file.eps file.png
convert file.eps file.tif

ImageMagick is available here.

example image

Upvotes: 0

user3021380
user3021380

Reputation: 166

"convert" will use ghostscript to render the eps, and then continues with the rendered bitmap; this makes it difficult to get the original image back, in most cases you get a re-sampled image.

I understand that you want the image out in the original resolution. I haven't got a direct route for you. However, for getting images from pdf files, you can use pdfimages. Assuming you are running this on a Linux box (or with cygwin)

ps2pdf file.eps
pdfimages file.pdf basename

This gives you a basename.pnm or basename.ppm file. Use convert to get it to jpeg or png. If you had a lossy format (jpg) in the .eps, this would re-code the jpg, so some additional loss is unavoidable.

convert basename.pnm file.jpg

or

convert basename.ppm file.png

p.s. The file from the question is no longer available. However, this answer might still be of interest to others.

Upvotes: 5

Related Questions