`convert "$input_filename" -resize $width "$output_filename"` if $width However, if a width is supplied the output is terribly blurry. This results in images that maintain aspect ratio, and if the geometry operation is based on height, the output is exactly what is intended. $image->Resize(geometry => "x$height") if $height $image->Resize(geometry => $width) if $width #METHOD 2ĭie "Only one dimension can be supplied" if $width & $height A comparable effect is had when supplying a width - the height is maintained, but the aspect ratio is not. For example, if a height of 100 is supplied, the output image will be the original width by 100 (3840x100). This results in images that do not maintain aspect ratio. $image->Write(filename => $output_filename) I have tried several different methods with the following results: #METHOD 1 Since I am attempting to perform these operations in bulk in conjunction with other operations I am attempting to perform these same operations in perl using Image::Magick. I can do this very simply using the convert command line utility with the following commands (in order): convert input_filename.jpg -resize x1000 output_wx1000.jpgĬonvert input_filename.jpg -resize x500 output_wx500.jpgĬonvert input_filename.jpg -resize x100 output_wx100.jpgĬonvert input_filename.jpg -resize 1600 output_1600xh.jpgĬonvert input_filename.jpg -resize 1200 output_1200xh.jpgĬonvert input_filename.jpg -resize 800 output_800xh.jpgĬonvert input_filename.jpg -resize 400 output_400xh.jpg Given an example image with dimensions of 3840 pixels × 2160 pixels (3840x2160) I want to create the following resized images: ?x1000 I want to always preserve the aspect ratio. All of the images I have as sources are large images and I want to resize them down to various intervals or either height or width. I am attempting to do some bulk resizing operations of images using ImageMagick and perlmagick (Image::Magick).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |