简体   繁体   English

Imagemagick动画gif大小优化

[英]Imagemagick animated gif size optimization

I am use this code to resize and save a animated gif (php): 我正在使用此代码来调整大小并保存动画gif(php):

system("convert *originalfile* -resize *size* -coalesce *newfile*); 

Once done the filesize is quite large. 完成后,文件大小会很大。 Usually larger than the original even! 通常比原来还要大! What can I do to reduce the file size? 如何减少文件大小?

I used convert $completeMiff -dither none -matte -depth 8 -deconstruct -layers optimizePlus -colors 32 $optimizedFile_16 and the file gets even bigger??? 我使用了convert $completeMiff -dither none -matte -depth 8 -deconstruct -layers optimizePlus -colors 32 $optimizedFile_16 ,文件变得更大了???

Add -layers optimize 添加-layers optimize

system("convert *originalfile* -resize *size* -coalesce -layers optimize *newfile*"); 

That worked well enough for me, when I faced this issue. 当我遇到这个问题时,这对我来说已经足够好了。 Looks like there are some more advanced options discussed here as well 看起来这里也讨论了一些更高级的选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM