我有两张照片:
http://www.eurocopter.in/contest/images/loader33.gif
如果您将看到第一个图像没有背景。背景看起来是白色的。第二幅图像有黑色背景。
发布于 2015-04-23 11:14:34
它们是动画GIF,第一个背景透明。您可以使用ImageMagick (安装在大多数Linux发行版上,对OSX和Linux免费提供)将映像分割成单独的帧,如下所示:
convert -coalesce type1.gif frame%02d.gif
它将为您提供以下18帧单独的图像
frame00.gif frame04.gif frame08.gif frame12.gif frame16.gif
frame01.gif frame05.gif frame09.gif frame13.gif frame17.gif
frame02.gif frame06.gif frame10.gif frame14.gif
frame03.gif frame07.gif frame11.gif frame15.gif
frame00.gif
如果你把它们做成这样的蒙太奇,你可以立刻看到它们:
convert -coalesce type1.gif miff:- | montage -tile x4 -frame 5 - montage.gif
您可以找到有关每个帧的信息,例如它的大小如下:
identify type1.gif
type1.gif[0] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[1] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[2] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[3] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000
type1.gif[4] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[5] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[6] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000
type1.gif[7] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[8] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[9] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[10] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000
type1.gif[11] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[12] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[13] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[14] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000
type1.gif[15] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000
type1.gif[16] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
type1.gif[17] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000
你可以像这样把所有的帧组合在一起:
convert frame* -loop 0 -delay 20 anim.gif
您可以尝试从第二个背景中移除黑色背景,以使其更像第一个背景,使用如下命令。您可能需要稍微修改一下fuzz
因素:
convert type2.gif -fuzz 15% -transparent black new.gif
发布于 2015-04-23 10:55:26
是的,你可以,你必须使用一些像Photoshop这样的照片编辑软件,试着按照这个指南中的步骤来做,让我知道它是如何进行的。
https://stackoverflow.com/questions/29821066
复制相似问题