def squeeze_gif():
    return (u"gifsicle -O2 '%(file)s' > '%(file)s'.diet "
            "&& mv '%(file)s.diet' '%(file)s'") if settings.DIET_GIFSICLE else ""
Gifsicle only optimizes animations.
dataset/ETHPy150Open samastur/image-diet/image_diet/diet.py/squeeze_gif