2011-04-01 180 views
7

我使用此代碼調整和保存gif動畫(PHP):ImageMagick的gif動畫尺寸優化

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

一旦完成了文件大小是相當大的。通常比原來的大!我能做些什麼來減少文件大小?

我用convert $completeMiff -dither none -matte -depth 8 -deconstruct -layers optimizePlus -colors 32 $optimizedFile_16和文件變得更大?

+0

這種情況發生時,即使您調整圖像的大小,我會採取它嗎? – Philip 2011-04-01 03:52:49

+0

你的原始文件格式是什麼? – Blender 2011-04-01 03:59:16

+0

原件是GIF動畫。是的菲利普 – alex 2011-04-01 19:06:28

回答

6

添加-layers optimize

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

這已經足夠好了我,當我面對這個問題。 Looks like there are some more advanced options discussed here as well

+0

我試着添加該選項,該文件仍然比原來的大,即使我把它調整到較小的尺寸。奇怪的... – alex 2011-04-01 20:24:15