LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-11-2016, 10:39 AM   #1
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,972
Blog Entries: 32

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
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?
 
Old 04-11-2016, 11:11 AM   #2
mjolnir
Member
 
Registered: Apr 2003
Posts: 815

Rep: Reputation: 99
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.

Last edited by mjolnir; 04-11-2016 at 11:14 AM.
 
Old 04-11-2016, 11:20 AM   #3
mjolnir
Member
 
Registered: Apr 2003
Posts: 815

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

You may have to modify them to suit your purpose.
 
1 members found this post helpful.
Old 04-11-2016, 12:14 PM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
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
 
1 members found this post helpful.
Old 04-11-2016, 12:50 PM   #5
cnamejj
Member
 
Registered: Mar 2015
Distribution: Ubuntu
Posts: 37

Rep: Reputation: Disabled
ImageMagick is a nice package for doing all sorts of image manipulation tasks. And it supports batch operations from the commandline.
 
1 members found this post helpful.
Old 04-11-2016, 02:59 PM   #6
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,972

Original Poster
Blog Entries: 32

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
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

Last edited by beachboy2; 04-12-2016 at 03:13 AM.
 
Old 04-11-2016, 03:07 PM   #7
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Converseen is another gui batch image converter and resizer.
 
Old 04-15-2016, 05:46 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

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


Reply

Tags
batch, photos, resizing



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] what are optimal settings for resizing photos sycamorex Linux - Software 2 05-30-2011 03:29 PM
LXer: Batch Process Photos in*digiKam LXer Syndicated Linux News 0 03-02-2011 12:40 PM
Method to batch resize photos with options michapma Linux - Software 10 02-08-2010 09:49 AM
Linux Cluster for Batch Image / Photo Resizing using Imagemagick w33d5 Linux - General 1 11-25-2008 08:05 AM
LXer: Batch process photos with Phatch LXer Syndicated Linux News 0 05-01-2008 10:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration