Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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


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
Old 11-27-2007, 10:59 AM   #2
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:
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.
mogrify -quality 50 -resize 100x100 *.jpg
Old 11-27-2007, 11:03 AM   #3
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
To resize exactly at 100x100 pixels
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
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,631

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


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:50 AM.

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