Converting Images to WebP From Terminal
Are you using a modern image format for your website image?
Published in
3 min readFeb 16, 2022
While optimizing Flowbite-Svelte website, Ligthhouse suggested to use WebP files instead of PNG and JPG files. So I created a Bash Script called Consize (CONvert and reSIZE).
After optimizing the images and adding meta tags, I got almost perfect scores.
After converting to WebP and resizing, an original image became very small in the size.
Requirements
This script requires imagemagick
and webp
are installed on your system.
If you are a macOS user:
brew install imagemagick
brew install webp
Debian/Ubuntu user:
sudo apt install imagemagick
sudo apt install webp
Installation
Let’s install consize
to your system. Select one of the following installation method.