PNG 到 eps 转换文件大小大幅增加

发布于 2024-10-07 14:46:31 字数 237 浏览 0 评论 0 原文

我正在将图像从 .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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

囚你心 2024-10-14 14:46:31

如果可以的话,使用 3 级后记。一般来说,级别 3 将生成最小的文件。级别 2 提供最佳兼容性,并且适用于 jpeg 图像。 (参见http:// Electron.mit.edu/~gsteele/pdf/

convert fig.png eps3:fig.eps

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 fig.png eps3:fig.eps
说谎友 2024-10-14 14:46:31

convert 确实会增大文件大小,因为它存储的是未压缩的图形数据。更好的压缩和更小的文件大小可以通过使用 gimp 手动转换来实现,或者通过执行以下操作来

convert image.png image.pdf
pdftops -eps image.pdf

实现:例如,在我的例子中,这会生成大小为 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 using gimp, or by doing

convert image.png image.pdf
pdftops -eps image.pdf

In 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).

当爱已成负担 2024-10-14 14:46:31

将 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.)

醉殇 2024-10-14 14:46:31

我遇到了类似的问题,并使用 -sample 参数:

convert image.png -sample 100 image.eps

并调整 -sample 值以满足您的需要。

另请参阅 ImageMagick v6 示例 --
调整大小或缩放

注意相反(从 EPS/PDF 到 PNG/JPG)可以使用 -密度

I had a similar problem and solved it using the -sample parameter:

convert image.png -sample 100 image.eps

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.

ぶ宁プ宁ぶ 2024-10-14 14:46:31

问题可能是您使用的 convert 应用程序不支持将 PNG 嵌入到 EPS 中。当使用正确配置的 Adob​​e 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文