从EPS提取图像数据 [英] Extract image data from EPS
问题描述
我有一个封装的PostScript 文件,该文件似乎只包装了图像文件;该文件位于此处.
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?
推荐答案
转换"将使用ghostscript渲染eps,然后继续渲染的位图.这使得恢复原始图像非常困难,在大多数情况下,您会获得重新采样的图像.
"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.
我了解您要以原始分辨率输出图像.我没有直接的路线给你.但是,要从pdf文件获取图像,可以使用pdfimages.假设您正在Linux机器上(或与cygwin一起)运行此程序
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
这将为您提供一个basename.pnm或basename.ppm文件.使用convert将其转换为jpeg或png.如果您在.eps文件中使用有损格式(jpg),则会重新编码jpg,因此不可避免地会造成其他损失.
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
或
convert basename.ppm file.png
p.s.问题中的文件不再可用.但是,其他人可能仍然对此答案感兴趣.
p.s. The file from the question is no longer available. However, this answer might still be of interest to others.
这篇关于从EPS提取图像数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!