LR/Mogrify2 - Crop/change aspect ratio

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Stilesy
Posts: 1
Joined: 2012-01-27T18:22:39-07:00
Authentication code: 8675308

LR/Mogrify2 - Crop/change aspect ratio

Post by Stilesy »

I've been using LR Mogrify for some time to automatically resize images on export. I usually supply clients with a 35mm aspect high res photo and the same in a 4:3 ratio web res file. The only way I have of changing the aspect ratio from 35mm to 4:3 is to add a white border top and bottom, however some clients don't like this. Using the 'Fit Inside (pixel dimensions supplied)' command squashes/distorts the image.

Is there a way to automatically resize + crop/trim the edges of these files on export from Lightroom 3 using Imagemagick?

Any help would be appreciated...


Stilesy
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: LR/Mogrify2 - Crop/change aspect ratio

Post by fmw42 »

Correct me if I am wrong, but I thought that 35mm corresponded to an aspect ratio of 4:3 or 1.33:1 (except for academy format of 35mm which is 1.37:1)

There is no aspect ratio resizing that I know about in IM. But you can resize to the smaller dimension so that the larger dimension is too big and then crop. See the ^ part of -resize at http://www.imagemagick.org/script/comma ... p#geometry as well as http://www.imagemagick.org/Usage/resize/#fill Note there should be no distortion when using this.

You will have to do some computations yourself to convert the aspect ratio to desired width and height for resize.

(Or you can use ! to force the resize to the specific dimensions, though it will distort your image.)

I do not believe that the Imagemagick developers have/had anything to do with LR, so for integration of LR with IM you probably need to ask the LR developers.

I will defer to the IM developers if I am wrong about any of this.

If you are on Linux/Mac, you can try my bash shell script, aspect, at the link below. It has the option to resize and crop. (And also see aspectpad, though you need the opposite action of crop rather than pad). Perhaps the former will be useful or at least they both will give you some idea about the computations.
Last edited by fmw42 on 2012-01-27T21:11:20-07:00, edited 2 times in total.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: LR/Mogrify2 - Crop/change aspect ratio

Post by anthony »

As Fred pointed out 35mm is a focus length, it is not an aspect ratio.

However you can use the 'Fill and Crop' to fit a image into a 4:3 box so that you trim the edges that does not fit.
No calculations are needed for the crop. Just the 'box size' you used for the resize.

See Cut the Thumbnail to Fit
http://www.imagemagick.org/Usage/thumbnails/#cut
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply