rails / sprockets

Rack-based asset packaging system
MIT License
947 stars 788 forks source link

Feature suggestion: Generate webp images too by default #789

Open Antronin opened 1 year ago

Antronin commented 1 year ago

Expected behavior

WebP is with us for more than 10 years. It has advantages over JPEG and/or PNG images and finally, nowadays most browsers are supporting it. I would suggest adding it as an opt-in feature to generate WebP image versions in the pipeline for PNGs and/or JPEGs. LibVips, MiniMagick, and ImageMagick already support the WebP format, so adding an optional post-processor is completely possible. There are already separate gems for this but I can find no gem which

https://github.com/0xjmp/rails-webp - last commit in 2021, uses ImageMagick https://github.com/kavu/sprockets-webp - last commit in 2018, uses libwebp through webp-ffi

Please let me know what do you think about the idea. Thank you.