Batch photo reduction


Batch image reduction in FreeBSD and GNU/Linux



For a site and not only, it is often necessary to reduce the size of the image, for various reasons sometimes it you need to reduce the image as a file or change the size of the photo, that is, its resolution. If you need to resize a couple of photos, you can use the GIMP-pom, but with a large number of images, reducing them in GIMP will be inconvenient and take a lot of time. And when you need to fit the size of all photos, batch photo reduction will help a lot. FreeBSD has an excellent tool with which you can change the size of all the photos that are in the same directory with one command.

I mean the console image editor imagemagick.


Install imagemagick


pkg install imagemagick


Then create a directory where we will put the photos we need, for example,


mkdir image


And we actually edit the image


mogrify -resize here size, file path, file extension.



For example:


mogrify -resize 50% /home/max/image/*.jpg


mogrify -resize 800×600 /home/max/image/*.bmp


mogrify -resize 640×480! /home/max/image/*.png