Better animated thumbs #65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now, the
thumb_keep_animation_frameslimits the maximum number of frames in the previews and requires the thethumb_extoption to be set to empty orgif, which is undesirable since we want our previews to be in the smallwebp.An extra
thumb_animated_extoption or something similar to generate animated previews in a desired format needs to be added.webmis preferable togifdue to it's better compression, but I am not sure if the browser treats them like an image. Investigation is requiredconverting a user gif into a thumbnail can be done like this (imagemagick 6.9.11)
convert original.gif -coalesce -filter Lanczos -resize "255x255>" -deconstruct miff:- | convert miff:- -define webp:method=6 -quality 50 thumb.webpthe settings can be adjusted to taste, currently results in:
images
random gif from images, a square, 904x904px, 245.5 kb
255x255px, 53.0 kb
alternate approaches:
using gif2webp handles conversion ok but does not have resize, meaning we have to do a more complicated 2-pass for questionable improvements
ffmpeg if you ever want to extend functionality to generating thumbnails of assorted videos, for gif to webp alone it's computationally intense
lmk if this helps
All of our thumbnails are webp, including gifs which we convert to animated webp.
I could only make it work using convert. gif2webp was subpar for thumbnail because of resize options and ffmpeg too intensive.
https://github.com/perdedora/nicochan/blob/master/inc/image.php#L367-L418
webp can be animated!?
@Zankaria wrote in #65 (comment):
Yes.
https://magalichan.com/media/b86e0279efef865522ce2fcd5ed5c02ed8c398ad8f7efebacb5f6c74b13a7fcf_t.webp