App-ImageMagickUtils

 view release on metacpan or  search on metacpan

script/calc-image-resized-size  view on Meta::CPAN

=item B<--resize>=I<s>*

Resize instruction, follows ImageMagick format.

Resize instruction can be given in several formats:

 Syntax                     Meaning
 -------------------------- ----------------------------------------------------------------
 ""                         No resizing.
 
 SCALE"%"                   Height and width both scaled by specified percentage.
 SCALEX"%x"SCALEY"%"        Height and width individually scaled by specified percentages. (Only one % symbol needed.)
 
 WIDTH                      Width given, height automagically selected to preserve aspect ratio.
 WIDTH">"                   Shrink width if larger, height automagically selected to preserve aspect ratio.
 WIDTH"^"                   Enlarge width if smaller, height automagically selected to preserve aspect ratio.
 
 "x"HEIGHT                  Height given, width automagically selected to preserve aspect ratio.
 "x"HEIGHT">"               Shrink height if larger, width automagically selected to preserve aspect ratio.
 "x"HEIGHT"^"               Enlarge height if smaller, width automagically selected to preserve aspect ratio.
 
 WIDTH"x"HEIGHT             Maximum values of height and width given, aspect ratio preserved.

script/calc-image-resized-size  view on Meta::CPAN

=head2 scale (down) to 20%

 % calc-image-resized-size 2592x1944 20%
 518x388

=head2 scale (down) width to 20% but height to 40%

 % calc-image-resized-size 2592x1944 20%x40%
 518x777

=head2 scale (down) width to 20% but height to 40% (first percent sign is optional)

 % calc-image-resized-size 2592x1944 20x40%
 518x777

=head2 set width to 1024px

 % calc-image-resized-size 2592x1944 1024
 1024x768

=head2 shrink width to 1024px



( run in 0.385 second using v1.01-cache-2.11-cpan-709fd43a63f )