LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 11:39 AM   #1
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 20.2 MATE, MX-19.3, antiX, EndeavourOS
Posts: 3,349
Blog Entries: 17

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
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, 12:11 PM   #2
mjolnir
Member
 
Registered: Apr 2003
Posts: 792

Rep: Reputation: 87
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 12:14 PM.
 
Old 04-11-2016, 12:20 PM   #3
mjolnir
Member
 
Registered: Apr 2003
Posts: 792

Rep: Reputation: 87
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, 01:14 PM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,825

Rep: Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735
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, 01: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, 03:59 PM   #6
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 20.2 MATE, MX-19.3, antiX, EndeavourOS
Posts: 3,349

Original Poster
Blog Entries: 17

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
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 04:13 AM.
 
Old 04-11-2016, 04:07 PM   #7
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,815

Rep: Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627
Converseen is another gui batch image converter and resizer.
 
Old 04-15-2016, 06:46 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,953

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


Reply

Tags
batch, photos, resizing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:29 PM
LXer: Batch Process Photos in*digiKam LXer Syndicated Linux News 0 03-02-2011 01:40 PM
Method to batch resize photos with options michapma Linux - Software 10 02-08-2010 10:49 AM
Linux Cluster for Batch Image / Photo Resizing using Imagemagick w33d5 Linux - General 1 11-25-2008 09:05 AM
LXer: Batch process photos with Phatch LXer Syndicated Linux News 0 05-01-2008 11:40 PM

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

All times are GMT -5. The time now is 10:24 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