I know this has been asked in a few different ways before but I am running into what seems to be a unique problem. I am using the following code to resize animated .gif images:
convert $image -coalesce $image
convert -layers OptimizeTransparency -quality 60 -size 220x220 $image -resize 220 +profile '*' $thumb`
In theory this should generate a thumbnailed/resized version of the .gif at 220px X 220px and keep it at a reasonable size by reducing quality and optimizing transparency, but in production it takes a 255kb .gif and turns it into a 1.5mb thumbnail. What is wrong with this code and how can I create more optimized .gif thumbnails?