ricardobalk / ricardobalk.nl

My personal website, made with Nuxt 3 (Vue 3), TypeScript & TailwindCSS
https://ricardobalk.nl
ISC License
0 stars 0 forks source link

Convert existing raster images to webp #60

Closed ricardobalk closed 4 years ago

ricardobalk commented 4 years ago

This issue is related to #10. While it is highly recommended to only use SVG-based artwork on websites, converting existing raster images to webp format is a reasonable approach to reduce data usage and loading times.

How to convert raster images to webp format on Linux / macOS

Step 1: Download the prerequisites

sudo apt install imagemagick webp
# or any other package manager that works for you (e.g. brew on macOS, apk on Alpine Linux)

Step 2: Convert

Go to the directory of files which have raster images to be converted into webp-format...

cd some-path/directory-with-raster-images
mogrify -format webp -strip -quality 60 *.jpg

Note: Change *.jpg to *.png to also process PNG-based images.

Done. Awesome.

Darkflib commented 4 years ago

https://www.igvita.com/2013/05/01/deploying-webp-via-accept-content-negotiation/