Compressed gif gets bigger

I have a gif file which is made bigger with compression. Why ? I know gif isn’t the best format but I tried to convert it lossless (or losslessly) to mp4, mov or webp and it only make it about 9 times bigger. I would like a function that automatically compare the size of compressed assets and warn if it gets bigger because arguably that is never the intent of the user.
Only ever a side-effect.

3.6M ├── transcendance_tranquility.gif 
939K ├── transcendance_tranquility_hu6a45a5541c100ecb57e6befebaaf963a_3645068_200x0_resize_q100_mitchellnetravali_1.gif 
4.2M └── transcendance_tranquility_hu6a45a5541c100ecb57e6befebaaf963a_3645068_400x0_resize_q100_mitchellnetravali_1.gif 

In this case the original image is 512 pixels wide.

I “solved” the issue with a 92% quality, giving a size proportional to the change in width, with little to no noticeable change in quality, considering that no reprocessing occurs when the original is smaller than a setting, and usually the version displayed is about between 50 and 100px wider, compensating for the slight compression :+1:

Welcome in the head-banging world of image compression I suppose…

GIF (as PNG) uses a losless compression (LZW), hence a “quality” seeing makes no sense. That’s different with JPEG and WEP, though.

is there a way to tell hugo to use whatever compression level the image is already encoded with, instead of actually decompressing when imaging.quality is higher ?
That would be the only logical behavior.