Requirements:
sudo apt install imagemagick
To convert all images in current directory and move resized to up to 1920 width, and with quality 90% to directory 'compress'
find . -maxdepth 1 -type f -name '*.jpg' -exec bash -c 'convert "$1" -resize 1920 -quality 90 "./compress/${1%.jpg}_compress.jpg" ' bash {} \;
Where find all images in current directory with .jpeg
extension and executes in bash XXX script
find . -maxdepth 1 -type f -name '*.jpg' -exec bash -c 'XXX' bash {} \;
Where XXX script is imagick convert with current file filename $1
and the base name of file name 1%.jpg
before .jpg
sufix:
convert image.jpg -resize 1920 -quality 90 "image_compress.jpg";