我正在将图像从 .png 转换为 .eps,这会极大地增加文件大小。
谁能解释一下这是为什么,以及如何防止它增加这么多。
我正在使用 Unix convert: convert image.png image.eps
感谢您的帮助
I'm converting an image from .png to .eps and it hugely increases the file size.
Can anyone explain why this is, and how to prevent it increasing so much.
I'm using Unix convert: convert image.png image.eps
Thanks for any help
发布评论
评论(5)
如果可以的话,使用 3 级后记。一般来说,级别 3 将生成最小的文件。级别 2 提供最佳兼容性,并且适用于 jpeg 图像。 (参见http:// Electron.mit.edu/~gsteele/pdf/)
Use level 3 postscript if you can. In general, level 3 will produce the smallest files. Level 2 provides the best compatibility, and works well with jpeg images. (see http://electron.mit.edu/~gsteele/pdf/)
convert
确实会增大文件大小,因为它存储的是未压缩的图形数据。更好的压缩和更小的文件大小可以通过使用gimp
手动转换来实现,或者通过执行以下操作来实现:例如,在我的例子中,这会生成大小为 0.3 MB 而不是 5.2 MB 的 eps 文件(直接使用
convert file.png file.eps
时)。convert
indeed blows up the file size because it stores the graphics data uncompressed. A better compression and smaller file size can be achieved by e.g. manually converting usinggimp
, or by doingIn my case, for example, this results in an eps file with a size of 0.3 MB instead of 5.2 MB (when using
convert file.png file.eps
directly).将 PNG 文件(专为位图数据设计)转换为 EPS(专为矢量数据设计)总是会导致文件大小变大,因为 EPS 实际上只是将 EPS 数据结构包裹在原始图像数据(最常用的图像数据)周围。可能不会像 PNG 文件那样有效地存储在任何地方)。
正确的解决方案是将位图存储为 PNG,将矢量图形存储为 EPS 或 SVG 等(即:对相关内容使用适当的文件格式,而不是试图强加一种毫无意义的“一刀切”方法。)
Converting a PNG file (designed for bitmap data) into an EPS (designed for vector data) is always going to result in a larger file size, as the EPS is effectively just wrapping an EPS data structure around the original image data (which it most likely won't store in anywhere near as effective a manner as a PNG file).
The correct solution is to store bitmaps as PNGs and vector graphics as EPS or SVG, etc. (i.e.: Use the appropriate file format for the content in question rather than attempting to impose a meaningless "one size fits all" approach.)
我遇到了类似的问题,并使用
-sample
参数:
并调整
-sample
值以满足您的需要。另请参阅 ImageMagick v6 示例 --
调整大小或缩放
注意相反(从 EPS/PDF 到 PNG/JPG)可以使用
-密度
。I had a similar problem and solved it using the
-sample
parameter:and tweak the
-sample
value to fit your need.Also see ImageMagick v6 Examples --
Resize or Scaling
N.B. The inverse (from EPS/PDF to PNG/JPG) can be tuned using
-density
.问题可能是您使用的
convert
应用程序不支持将 PNG 嵌入到 EPS 中。当使用正确配置的 Adobe Acrobat Professional 时,我的新用户意外地发现文件大小大幅增加。但您应该首先正确配置“PNG 到 PDF”转换设置。然后,您应该从 Acrobat 将生成的 PDF 导出(或另存为)为 EPS。It is possible that the problem is that the
convert
application you use just does not support embedding PNG into EPS. When using properly configured Adobe Acrobat Professional I newer got unexpectedly huge increase of the file size. But you should properly configure first your "PNG to PDF" conversion settings. Then you should export (or Save As) generated PDF as EPS from Acrobat.