【问题标题】:How to extract frames from a GIF file preserving frame dimensions如何从保留帧尺寸的 GIF 文件中提取帧
【发布时间】:2012-09-29 06:44:43
【问题描述】:

我有以下 GIF 图片文件:

我想使用这个 imagemagick 命令提取它的帧(使用 PGM 输出格式):

convert brocoli.gif out%05d.pgm

但每一帧都有不同的大小。

如何在保留原始 gif 文件大小的同时提取其帧?

【问题讨论】:

  • 西兰花核磁共振成像?
  • 是的! (lorem ipsum 文本)
  • 我已经多次看过这个西兰花核磁共振成像了。令人着迷。

标签: imagemagick gif


【解决方案1】:

使用-coalesce 选项:

convert -coalesce brocoli.gif out%05d.pgm

【讨论】:

  • 这很好用!对于像我一样对此选项感到困惑的人,文档说Overlay each image in an image sequence according to its -dispose meta-data, to reproduce the look of an animation at each point in the animation sequence
  • 我会在死灵术方面给你一个建议,乔.. @gipi 我不是 gif 或 imagemagick 专家,但我对 GIF 的理解是它是一系列相当独立的图像,其中序列中的每个图像可以是不同的大小。它们相互叠加以产生整体动画。这提供了一些压缩,因为不改变的图像部分不包含在每一帧中。根据您引用的文档,-coalesce 在导出之前对每个帧进行整体分层。
【解决方案2】:

你可以使用 graphicsmagick:

gm convert Test.gif +adjoin Test_image%3d.png

gm convert Test.gif -coalesce +adjoin Test_image%3d.png.

【讨论】:

    猜你喜欢
    • 2014-12-22
    • 2010-10-31
    • 2018-05-09
    • 1970-01-01
    • 1970-01-01
    • 2015-06-09
    • 2012-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多