How to bulk resize images in folder in openSUSE Linux (with screenshots)

Written by Administrator on Wednesday April 1, 2020

Sometimes we need to rezise many images to publish them on website or to send via e-mail. In linux you can do it very fast within several minutes. All we need is to install imagemagick utility:

Let's visit official website of imagemagick utility and download it:

This particular version of imagemagick doesn't require installation, so we can use it directly. Let's check, that imagemagick is prepared for use:

$ magick --version

Yep, it's ready. Now we need to choose a folder with images we want to resize. Our working directory with heaps of images will be /home/dima/centos_installation (because I needed to send installation photos do my colleague):

$ cd ../centos-installation/ && ls

As you see, all files in a folder have the same extension (.JPG). It's good, because we can work with them in a bulk. I want to resize all images to a 30% size of their original size and mark resized images filenames with a prefix (because I'm afraid to edit or hurt original files). So, I run a command:

$ for i in $( ls *.JPG); do convert -resize 30% $i resized_$i.JPG; done

Ready! On a screenshot you can see the difference between size of original images and resized.