LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Batch resizing of photos in Linux (https://www.linuxquestions.org/questions/linux-software-2/batch-resizing-of-photos-in-linux-4175577186/)

beachboy2 04-11-2016 10:39 AM

Batch resizing of photos in Linux
 
I used to use a Windows program called PixResizer for batch resizing photos:

http://bluefive.pair.com/pixresizer.htm

It is excellent software and does the job perfectly in seconds.

However, I have had so many problems with W7 updates that I have now scrapped Windows totally.

There is only a certain amount of "Preparing To Configure Windows. Please Do Not Turn Off Your Computer" that anybody can take.


I would like to find an easy way of batch resizing photos in Linux.

Let's say that I have a folder called FALCONS which contains 100 photos.

Each photo is a .jpg at 3072 X 2304.

I would like to resize every photo in a single operation, using the command line, to 600 pixels wide, whilst keeping the same aspect ratio.

I would like to put the resized photos in a new folder called FALCONS_R600.

Any suggestions?

mjolnir 04-11-2016 11:11 AM

I have used a perl script I found online to batch re-size/annotate folders of pictures. I think the script called the 'convert' function of ImageMagick but I'm not sure. I don't have access to it right now but that will give you a good starting point for a search.

Edit: by the way I think there are extensions for Gimp on Windows to do the same thing. I've used Gimp 2.8 on Win10 to re-size a single photo but I haven't tried to do multiples.

mjolnir 04-11-2016 11:20 AM

I used scripts from here: http://kimbriggs.com/computers/compu...ipulation.file

You may have to modify them to suit your purpose.

camorri 04-11-2016 12:14 PM

mogrify
 
Here is a little how-to resize digital images.

Quote:

HowTo – Batch Image Resize on Linux
Suppose you want resize every your photos to put it on web. As you know, you can’t upload your photos on a webpage with the highest resolution because a web gallery became inaccesible and too slow to load. Suppose that you have a folder containing every photos of you holidays and you want resize it at 640 of width mantaining original aspect ratio. To make a resize there are many tools but I suggest a command line tool called “mogrify”. This tool will be installed with ImageMagick Libraries, so you have to install ImageMagick on you Linux.

I assuming that you have installed Ubuntu Gutsy:
sudo apt-get install imagemagick
After ImageMagick installation, you can use mogrify. For example, I have a folder called “holidays” locate in “/home/user/photos/“. I have to change my path, make a thumbs folder and copy original images on “thumbs folder”. After that I can start image resizing process:
cd /home/user/photos/holidays
mkdir thumbs
cp /home/user/photos/holidays/* /home/user/photos/holidays/thumbs/
cd thumbs
mogrify -resize 640 *.jpg
Now I can see on “/home/user/photos/holidays/thumbs/” every my image file resized to 640 of width. If you want force resizing to a particulare size without mantaining original aspect ratio you could change mogrify options:
mogrify -resize 640×480! *.jpg

cnamejj 04-11-2016 12:50 PM

ImageMagick is a nice package for doing all sorts of image manipulation tasks. And it supports batch operations from the commandline.

beachboy2 04-11-2016 02:59 PM

Many thanks to all who responded.

I will mark this as SOLVED.

@camorri,

Code:

sudo apt-get install imagemagick

cd /home/user/photos/holidays
mkdir thumbs
cp /home/user/photos/holidays/* /home/user/photos/holidays/thumbs/
cd thumbs
mogrify -scale 640 *.*

(mogrify -resize 640 *.jpg threw up an error).

I also found this useful link:

http://www.greplinux.net/2012/08/mog...le-images.html

descendant_command 04-11-2016 03:07 PM

Converseen is another gui batch image converter and resizer.

chrism01 04-15-2016 05:46 AM

I can also recommend GraphicsMagick; avail from the EPEL repo and http://www.graphicsmagick.org/


All times are GMT -5. The time now is 10:04 AM.