Page 1 of 1
How do I batch resize images with different orientations?
Posted: 2017-01-20T10:50:34-07:00
by jweinraub
I have a huge folder of images in a variety of orientations and resolutions that I would like to all be processed since i want them to be all 4x6 or 6x4 and cropped to fit that size if can't to keep the aspect ratio clean and not stretched but i am unsure how to determine orientation so globally making it all one size won't work and since resolutions are all different, changing percent won't work either. if at all possible as well, can they be cleaned like autolevels/autocurves that photoshop does per chance?
Re: How do I batch resize images with different orientations?
Posted: 2017-01-20T10:57:11-07:00
by fmw42
I am not sure I understand your problem with orientations and aspect. Can you provide some example images to show the issue and explain further. Imagemagick mogrify will be able to apply -auto-level or -contrast-stretch to all images in any one folder.
If you images have EXIF data, then there may be a stored orientation and so you can use the IM command -auto-orient to handle correcting the orientation.
You can post images to any free hosting service such as dropbox.com and put the URLS here.
Also please always provide your IM version and OS/platform.
Re: How do I batch resize images with different orientations?
Posted: 2017-01-20T13:04:43-07:00
by jweinraub
I am using
Version: ImageMagick 6.8.9-9 Q16 x86_64 2016-08-25
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
I have two pictures say, one was taken portrait one was taken landscape, I want to simply resize them to 4x6" or 6x4" depending on its orientation.
Re: How do I batch resize images with different orientations?
Posted: 2017-01-20T16:29:09-07:00
by fmw42
Do they both already have 4:6 or 6:4 aspect ratio? If not, then you need to decide whether your want 1) to resize with distortion, 2) resize and crop or 3) resize and pad. Is the image already the correct size in one dimension?
Please provide an example image and explain what you need done to it in terms of new dimension.
See
http://www.imagemagick.org/script/comma ... p#geometry
http://www.imagemagick.org/Usage/resize/#resize
http://www.imagemagick.org/Usage/thumbnails/#fit
http://www.imagemagick.org/Usage/thumbnails/#pad
http://www.imagemagick.org/Usage/thumbnails/#cut
User -resize rather than -thumbnail if you want to keep meta data.