LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-27-2007, 10:34 AM   #1
ewingtux
LQ Newbie
 
Registered: Nov 2007
Posts: 10

Rep: Reputation: 0
Resizing to 100 x 100 with ImageMagick


Hi,

I have just grabbed a load of images to a folder with wget. However they are all different sizes and over 100 pixels wide and I need to resize each of them so they fit into a 100 x 100 pixel size.

Does anyone know the command I can used in bash to do this? (perhaps to reduce quality by 20% also ie. 80% of original quality)

Thanks in advance
Ed
 
Old 11-27-2007, 10:59 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
To resize a bunch of .jpg files:
Code:
mogrify -resize 100x100 *.jpg
You can specify a quality with a -quality option, which you might as well do at the same time. The files will be re-encoded as part of the resize, so just choose a quality level you like. e.g.
Code:
mogrify -quality 50 -resize 100x100 *.jpg
 
Old 11-27-2007, 11:03 AM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,488

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
To resize exactly at 100x100 pixels
Code:
convert <input-image> -resize 100x100! <output-image>
but if you want a maximum size of 100 pixels and mantain the aspect ratio, take out the exclamation mark. A list of options to the convert command is available on the ImageMagick website, here.

Edit: uh... I did not know mogrify... sure better!

Last edited by colucix; 11-27-2007 at 11:05 AM. Reason: Not seen previous post before posting
 
Old 11-27-2007, 03:53 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,066

Rep: Reputation: 491Reputation: 491Reputation: 491Reputation: 491Reputation: 491
Code:
convert -thumbnail width
convert -thumbnail widthxheight{%} {@} {!} {<} {>}

create a thumbnail of the image.

This is exactly like -resize, except that any image profiles present are also removed as they are of little importance to small image thumbnails.
jlinkels
 
  


Reply

Tags
imagemagick, resize


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
10/100/100 Mbps D-link NIC on fc5 abhishekrahel Linux - Hardware 2 11-22-2007 02:18 AM
100% cpu use 100% of the time serafean Linux - Newbie 4 05-04-2006 03:36 PM
deleting 100 rows in text file (1-100) via terminal itz2000 Linux - Newbie 5 01-17-2006 11:19 PM
Xircom CreditCard 10/100 CE3-10/100 driver not loaded under FEDORA or RHEL androphag Linux - Laptop and Netbook 1 02-06-2005 01:35 AM
RBEM56G-100 Xircom RealPort Cardbus Ethernet 10/100+Model 56 Linux Drivers/ Phalk sxa Linux - Laptop and Netbook 1 06-12-2004 11:20 AM


All times are GMT -5. The time now is 12:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration