我可以在每个图像中分离一个 Gif 吗?
Can I separate a Gif in each image is conformed?
我想知道是否有任何工具或者是否有任何方法可以从 gif 文件中获取,并为每个图像保存一个文件。
这样我就可以将每个帧分隔在一个文件中。
使用python
在 python 中制作的脚本可用 here:
import os
from PIL import Image
def extractFrames(inGif, outFolder):
frame = Image.open(inGif)
nframes = 0
while frame:
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF')
nframes += 1
try:
frame.seek( nframes )
except EOFError:
break;
return True
extractFrames('ban_ccccccccccc.gif', 'output')
ban_ccccccccccc.gif
是您的 GIF
图像的名称,output
将保存帧的文件夹的名称。
我想知道是否有任何工具或者是否有任何方法可以从 gif 文件中获取,并为每个图像保存一个文件。
这样我就可以将每个帧分隔在一个文件中。
使用python
在 python 中制作的脚本可用 here:
import os
from PIL import Image
def extractFrames(inGif, outFolder):
frame = Image.open(inGif)
nframes = 0
while frame:
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF')
nframes += 1
try:
frame.seek( nframes )
except EOFError:
break;
return True
extractFrames('ban_ccccccccccc.gif', 'output')
ban_ccccccccccc.gif
是您的 GIF
图像的名称,output
将保存帧的文件夹的名称。