* [gentoo-user] resizing multiple images with adding a frame as needed
@ 2015-06-23 14:46 hw
2015-06-23 15:54 ` wabenbau
2015-06-24 0:02 ` wabenbau
0 siblings, 2 replies; 7+ messages in thread
From: hw @ 2015-06-23 14:46 UTC (permalink / raw
To: gentoo-user
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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] resizing multiple images with adding a frame as needed
2015-06-23 14:46 [gentoo-user] resizing multiple images with adding a frame as needed hw
@ 2015-06-23 15:54 ` wabenbau
2015-06-24 0:02 ` wabenbau
1 sibling, 0 replies; 7+ messages in thread
From: wabenbau @ 2015-06-23 15:54 UTC (permalink / raw
To: gentoo-user
hw <hw@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?
You maybe can use media-gfx/graphicsmagick or media-gfx/imagemagick
for that purpose (I prefer graphicsmagick because it's faster).
With the composite command and it's repage parameter it should be
possible to do what you want. But I'm not sure about this, I never
done this by myself.
--
Regards
wabe
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] resizing multiple images with adding a frame as needed
2015-06-23 14:46 [gentoo-user] resizing multiple images with adding a frame as needed hw
2015-06-23 15:54 ` wabenbau
@ 2015-06-24 0:02 ` wabenbau
2015-06-24 5:35 ` Mick
2015-06-29 15:38 ` hw
1 sibling, 2 replies; 7+ messages in thread
From: wabenbau @ 2015-06-24 0:02 UTC (permalink / raw
To: gentoo-user
hw <hw@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-image-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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] resizing multiple images with adding a frame as needed
2015-06-24 0:02 ` wabenbau
@ 2015-06-24 5:35 ` Mick
2015-06-29 15:34 ` hw
2015-06-29 15:38 ` hw
1 sibling, 1 reply; 7+ messages in thread
From: Mick @ 2015-06-24 5:35 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 1774 bytes --]
On Wednesday 24 Jun 2015 01:02:35 wabenbau@gmail.com wrote:
> hw <hw@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
============================================
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] resizing multiple images with adding a frame as needed
2015-06-24 5:35 ` Mick
@ 2015-06-29 15:34 ` hw
2015-06-29 19:15 ` Mick
0 siblings, 1 reply; 7+ messages in thread
From: hw @ 2015-06-29 15:34 UTC (permalink / raw
To: gentoo-user
Am 24.06.2015 um 07:35 schrieb Mick:
> On Wednesday 24 Jun 2015 01:02:35 wabenbau@gmail.com wrote:
>> hw <hw@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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] resizing multiple images with adding a frame as needed
2015-06-24 0:02 ` wabenbau
2015-06-24 5:35 ` Mick
@ 2015-06-29 15:38 ` hw
1 sibling, 0 replies; 7+ messages in thread
From: hw @ 2015-06-29 15:38 UTC (permalink / raw
To: gentoo-user
Am 24.06.2015 um 02:02 schrieb wabenbau@gmail.com:
> hw <hw@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-image-inside-a-larger-canvas
>
> You must add a resize paremeter as this example is only for placing an
> image inside a larger canvas. :-)
Thank you very much, this looks like exactly what I was looking for :)
> You can easily find more examples in the Internet.
I tried, of course --- it seems to be a matter of using the right search
strings ...
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] resizing multiple images with adding a frame as needed
2015-06-29 15:34 ` hw
@ 2015-06-29 19:15 ` Mick
0 siblings, 0 replies; 7+ messages in thread
From: Mick @ 2015-06-29 19:15 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 2803 bytes --]
On Monday 29 Jun 2015 16:34:16 hw wrote:
> Am 24.06.2015 um 07:35 schrieb Mick:
> > On Wednesday 24 Jun 2015 01:02:35 wabenbau@gmail.com wrote:
> >> hw <hw@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-i
> >> mag 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?
No, the above example will resize it to the dimensions you give it.
You can however define the '-geometry' instead and do it in many different
ways so as to preserve the aspect ratio. For example if you only give it '-
geometry width', then the hight will be automatically adjusted to preserve the
current aspect ratio. If you only give '-geometry xheight' then the width
will be auto-adjusted to retain the aspect ratio.
You can also use scale% as a geometry parameter to increase the image by a
particular percentage. Have a look at:
file:///usr/share/doc/imagemagick-6.9.0.3/html/www/command-line-
processing.html#geometry
(depending on your version of imagemagick) for more information.
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-06-29 19:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-23 14:46 [gentoo-user] resizing multiple images with adding a frame as needed hw
2015-06-23 15:54 ` wabenbau
2015-06-24 0:02 ` wabenbau
2015-06-24 5:35 ` Mick
2015-06-29 15:34 ` hw
2015-06-29 19:15 ` Mick
2015-06-29 15:38 ` hw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox