问题
I have an encapsulated PostScript file which appears to only wrap an image file; the file is here.
Is there a tool to extract the image data from it?
回答1:
"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.
回答2:
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.
来源:https://stackoverflow.com/questions/25166187/extract-image-data-from-eps