Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Imagemagick animated gif size optimization

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

like image 620
alex Avatar asked Apr 01 '11 03:04

alex


1 Answers

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

like image 87
Frank Farmer Avatar answered Oct 18 '22 20:10

Frank Farmer