Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 23, 2007, 12:55 pm
rate this thread
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;
When a resulting thumbnail image become less than 100 pixels wide I'd like
to add padding on left and right in some solid color, making the jpeg
including the solid area, to exactly 100 pixels wide.
If however a resulting thumbnail is wider than 100 pixels, I'd like it
cropped equally, or to the nearest pixel, on the left and right edges, so
that it becomes exactly 100 pixels wide.
This is like placing the resulting 75 pixes tall image in the center
of a canvas which is exactly 100x75 pixels, and discarding the excess area
I'm not sure if this can be done with the Image Magick toolset alone, and
if not, is there an easy way to do this using PerlMagick?
Re: Converting images with padding or cropping on left and right
This is easily done using -border/-crop on the command line, or with
PerlMagick using Border/Crop methods.
"If anyone disagrees with anything I say, I am quite prepared not only to
retract it, but also to deny under oath that I ever said it." -Tom Lehrer
- » RFC: Crypt::Skip32 - 32-bit block cipher based on Skipjack
- — Previous thread in » PERL Modules Announcements