Am 24.06.2015 um 07:35 schrieb Mick:
On Wednesday 24 Jun 2015 01:02:35 waben...@gmail.com wrote:
hw <h...@gartencenter-vaehning.de> wrote:
Hi,
suppose I have a number of images that need to be displayed side by
side in a nice layout. The images are of different sizes and have
different aspect ratios.
To fit the images into the layout, I can scale the images either by
height or width or by percantage, and they will look messy in the
layout because I need to keep their aspect ratio when scaling them.
So what I need to do is put a frame around each image just as needed
when scaling it so that I will end up with all the images having the
same size while maintaining their aspect ratio.
I guess 'convert' (from imagemagick) or 'ffmpeg' can do this, yet I
couldn't find out how.
(In this particular case, I would set a default size to scale all
images to rather than doing something more complicated like examine
all images in advance to compute a good size to use from the largest
or smallest one or from their average dimensions.)
Any ideas how to do this?
Look here:
http://stackoverflow.com/questions/1787356/use-imagemagick-to-place-an-imag
e-inside-a-larger-canvas
You must add a resize paremeter as this example is only for placing an
image inside a larger canvas. :-)
You can easily find more examples in the Internet.
--
Regards
wabe
Give this a spin, or modify accordingly to suit your needs:
============================================
#!/bin/bash
for i in *.JPG; do
name=${i%.JPG}
convert -resize 900x675 ${i} ${name}_s.jpg
done
============================================
This doesn't add a frame to keep the aspect ratio, or does it?