This picture bealow behaves badly with resizing.
What I wrote here was wrong, changing quality has no effect whatsoever, because it’s a lossless format. ut there is a resizing, so I would expect the size to go down, but it goes up. You can find the file here.
Output of mediainfo:
File size : 3.48 MiB
Image
Format : GIF
Format/Info : Graphics Interchange Format
Format profile : 89a
Width : 512 pixels
Height : 512 pixels
Compression mode : Lossless
Animated GIFs has a concept of both global and local colour palettes, which I guess could make a given encoder implementation (the one you used for the source GIF) more effective than the one we use (the one in Go’s stdlib).
That means hugo’s library and imagemagick are equivalent, ok, but does not explain why both manage to increase the size, be less efficient that this image’s native format or whatever. also, I tried gif2-webp, which is provided by google, and also converting to avif with ffmpeg. Everything increases the size, from double to triple…
Once upon a time someone created the animated GIF. Each frame of the GIF is LZW compressed, per the GIF specification.
Then they “optimized” the animated GIF, using a local tool or one of the many, free online services. These apps optimize via LOSSY compression of each frame (reducing file size), then re-encode to LZW (LOSSLESS) per the GIF spec.
I used one these services to “optimize” the file created in Step 2 above, and the result was around 4 MB.
Okay, I converted with gif2webp -q 100 -min_size -mt -loop_compatibility transcendance_tranquility.gif -o transcendance_tranquility.webP
and of course I get
error calling Resize: image “/home/drm/Images/memes/transcendance_tranquility.webp”: resize /Images/memes/transcendance_tranquility.webp: webp: invalid format
No comment… The same that happened with transparent webp and gimp once. except this time, cwebp fails because it’s animated.