Extract image data from EPS

拥有回忆 提交于 2019-12-10 21:15:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!