Scaling images using imagemagick

1. Downscale images (batch)

Just a useful command I use to downscale my images, for example to share them on social media.

magick mogrify -auto-orient -strip -resize "1920x1920>" -quality 85 *.jpg

Some explaination:

2. Convert images to webp

I like to archive thumbnails of images. This way, you can store tons of images in small disk space.

magick convert -auto-orient -strip -resize "600x600>" -quality 75 -define webp:method=6 -define webp:use-sharp-yuv=1 image.jpg image.webp

3. Create animated webp

img2webp -d 300 -lossy -m 6 -min_size -o animated.webp *.jpg

4. Batch processing

for i in *.jpg; do magick convert /* your options */ $i ${i/.jpg/.webp}; done