[prev in list] [next in list] [prev in thread] [next in thread]
List: imagemagick-user
Subject: Re: [magick-users] Converting images with padding or cropping based
From: Anthony Thyssen <anthony () griffith ! edu ! au>
Date: 2007-09-24 2:19:24
Message-ID: 200709240219.l8O2JOgw025612 () wraith ! itc ! griffith ! edu ! au
[Download RAW message or body]
Tuxedo on wrote...
| I have a simple shell procedure that batch converts original jpeg's in
| various sizes into thumbnail copies maximum 75 pixels in height:
|
| for i in *.jpg
| do convert -quality 70 -geometry x75 $i ../img/`basename $i .jpg`.jpg;
| done
|
| I'd like it that when a resulting thumb becomes less than 100 pixels
| wide to add padding on left and right in some solid color, making the
| jpeg including the solid area exactly 100 pixels wide.
|
| If however a resulting thumb becomes wider than 100 pixels, I would
| then then like it cropped on the left and right edges so it becomes
| exactly 100 pixels wide.
|
| This is as if placing the resulting 75 pixes tall image in the center
| of a canvas which is exactly 100x75 pixels, and cropping the resulting
| thumb only if necessary.
|
| Exactly how can this be done? Which Image Magick methods and tools are
| suitable for this? Any examples would be greatly appreciated.
|
See IM Examples, Thumbnails, Padding Out Images...
http://www.imagemagick.org/Usage/thumbnails/#pad
It gives about 4 different techniques in various ways, depending on your
version on IM.
Anthony Thyssen ( System Programmer ) <A.Thyssen@griffith.edu.au>
-----------------------------------------------------------------------------
My girlfriend's just an object to me. Unfortunately, there is some
information hiding, but thankfully, she's fairly encapsulated, nicely
modular, and has a very well defined interface!
-- Frank Fabbrocino <fabbroci@sal-sun2.usc.edu>
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
Magick-users@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic