Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
Linux下对gif动画批处理的办法。
Apps Section
380
views ·
0
replies ·
To
floor
Go
蒙笛
deepin
2018-07-05 01:03
Author
本帖最后由 yuzh496 于 2020-4-5 20:27 编辑
(一)——————————————————————————————————————————————————
对jpg等普通图像批处理可以用xnview或者gimp,gimp需要安装bimp插件或者dbpSrc插件,详细办法请参考
bimp项目地址:
https://alessandrofrancesconi.it/projects/bimp/
David's Batch Processor GIMP plugin
https://sourceforge.net/projects/gimpdbpplugin/
(二)——————————————————————————————————————————————————
这些方法对于批量处理gif动画来说好像都无效,处理以后gif动画变成了静态的gif图像。
百度、bing、google,大体解决方案有两种:
1.用imagemagick,注意转换gif动画需要中间的temp.gif过渡一下。
sudo apt-get install imagemagick
convert input.gif -coalesce temp.gif
convert -size [orig-size-of-input-gif] temp.gif -resize [target-size] resized.gif
Copy the Code
2、用Gifsicle
sudo apt-get install gifsicle
gifsicle input.gif --resize [target-size] > resized.gif
Copy the Code
这部分参考帖子:
How to resize an animated GIF image in Linux
,看起来用gifsicle更加直接。
(三)——————————————————————————————————————————————————
批处理实现的办法:
$ for i in $( ls *.jpg); do convert -resize 50% $i re_$i; done
Copy the Code
参考帖子:
Batch image resize using Linux command line
(四)——————————————————————————————————————————————————
综合以上办法,利用Gifsicle 实现对gif动画的批处理
for i in $( ls *.gif); do gifsicle -b --colors 256 --scale 0.5 $i; done
Copy the Code
最后不得不说:Gifsicle真强大, 详细参数请参考
https://www.lcdf.org/gifsicle/man.html
, 啥时候能有它的图形端,命令行强大,但不直观、不习惯。
写个帖子自己备查,有需求的同学也可以参考。
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
【Enhanced Repo】Better Deepin Repo is released
Popular Events
More
(一)——————————————————————————————————————————————————
对jpg等普通图像批处理可以用xnview或者gimp,gimp需要安装bimp插件或者dbpSrc插件,详细办法请参考
bimp项目地址:https://alessandrofrancesconi.it/projects/bimp/
David's Batch Processor GIMP plugin https://sourceforge.net/projects/gimpdbpplugin/
(二)——————————————————————————————————————————————————
这些方法对于批量处理gif动画来说好像都无效,处理以后gif动画变成了静态的gif图像。
百度、bing、google,大体解决方案有两种:
1.用imagemagick,注意转换gif动画需要中间的temp.gif过渡一下。
2、用Gifsicle
(三)——————————————————————————————————————————————————
批处理实现的办法:
Batch image resize using Linux command line
(四)——————————————————————————————————————————————————
综合以上办法,利用Gifsicle 实现对gif动画的批处理
最后不得不说:Gifsicle真强大, 详细参数请参考 https://www.lcdf.org/gifsicle/man.html, 啥时候能有它的图形端,命令行强大,但不直观、不习惯。
写个帖子自己备查,有需求的同学也可以参考。