Forem Creators and Builders 🌱

Discussion on: What are we missing?

 
rhymes profile image
rhymes

No, they don't. I mean, I think the goal to have GIFs as cover images passes through uploading GIFs, converting them to MP4 and embedding videos. It would also solve a few other problems like size and security:

Optimize uploaded GIFs #3638

Is your feature request related to a problem? Please describe.

Uploaded GIFs for use in articles are not optimized and therefore can be very large and slow for users to download.

Describe the solution you'd like

Since dev.to is using Cloudinary for its assets, there is the opportunity to easily apply lossy compression to GIFs to reduce GIF file sizes by 20-50% (without too large a hit on quality): cloudinary.com/blog/lossy_compress...

If quality should not be sacrificed, then there is also the possibility to use the HTML5 <video> element and display GIFs as automatically looping videos. Fortunately, Cloudinary also allows GIF assets to be requests as videos where Cloudinary will convert the .gif file to a .mp4 (or any other supported video format): cloudinary.com/blog/reduce_size_of...

Twitter actually converts all their GIFs to mp4 files and this helps reduce the GIF size by around 95%!

This may be difficult to implement considering the markdown asset would need to be converted to an HTML <video> element. Also, browser support will need to be considered to make sure autolooping videos work everywhere.

Additional context

When running performance audits with Lighthouse, the audits usually point towards the following resource when suggesting ways to optimize GIF assets: developers.google.com/web/fundamen...

I've also recently written a blog post regarding the switch of GIFs to videos and also analyze dev.to's implementation of GIFs in the article: robertcooper.me/stop-using-gifs

Thread Thread
 
lee profile image
Lee

Ah great, looks like from recent comments, this in progress!