Imagemagick animated gif size optimization

2019-04-07 07:26发布

问题:

I am use this code to resize and save a animated 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???

回答1:

Add -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