Why are gif transform file sizes very large?
No Current Good Solution

Having liaised directly with Craft Support on this issue, the outcome after a bit of research was that there is not currently any good solution.

Apparently, Imagick is really, really bad at animated GIFs, but there's no other option.

My workaround was to edit the templating for gif images, so a super-simplified version would look something like the following:

{% set src = image.getUrl('someTransform') %}

{# No transform used for gifs #}
{% if image.getMimeType() == 'image/gif' %}
    {% set src = image.getUrl() %}
{% endif %}

&lt;img src="{{ src }}"&gt;


Whilst this did result in larger than ideal file sizes for gifs (because the original file was being used rather than smaller transforms), it prevents the issues detailed above. Not great, but better than the enormous file sizes we were seeing and the tasks getting stuck!

Possibilities in Craft 3

Apparently, Craft 3 allows for further image optimisation after transforms, and there's a plugin that capitalises on this already, so hopefully, we'll see some improvement in Craft 3.