First, please install “Brew” , the package manager for Mac :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install an updated version of Bash for Mac:
brew install bash
If you have problems updating Bash, please follow this link.
Now, install the packages:
brew install imagemagick
brew install webp
brew tap shinokada/consize
brew install consize
With consize , use the -d
parameter to specify the directory. Use the -q
parameter to specify the compression factor for RGB channels between 0 and 100.
Converting PNG/JPG/JPEG to WebP format in a directory:
cd path/to/dir
consize img2webp -d . -q 90
For resizing images:
consize resize -d . -w 540 -h 284
// or
consize resize -d . -w 480
FONT personal experience and https://medium.com/mkdir-awesome/converting-images-to-webp-from-terminal-ab84f3bc6e20
Una resposta a “Bulk convert IMG to WebP with terminal on Mac”
[…] Durant aquest procés he vist que moltes d’aquestes imatges tenien un duplicat en “.png” i que donava problemes amb la conversió a WEBP recursiva que es pot realitzar a Linux i MAC. […]