Compress or Resize images in BASH

sudo apt-get install imagemagick
#!/bin/sh
 
if [ ! -d ./output ]; 
then
  mkdir output
fi
 
for item in *.jpeg;
do
  echo "Converting ${item%.jpeg}"
  convert ${item} -resize 1024 ${item%.jpeg}.png 5
done

see more options: https://www.imagemagick.org/script/convert.php

howto/compress_or_resize_images_in_bash.txt · Last modified: 2016/11/23 07:38 by yehuda
Back to top
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0