Crop photo at set (3:2) ratio, with user input?

My website uses a "featured image" field that is best with a ratio of 3x2. (Ideally, I set my images at 1500x1000 pixels.) When I export my own photos, I always set that 3x2 crop ratio. But I often get user-submitted photos that are not the correct ratio (and are often much larger images shot with someone's iPhone).

I would love to create a KM macro to quickly crop and resize images without having to open Lightroom or some other heavy app. The issue is that I can't just crop it blindly. I need to be able to say "crop off the top on this photo" but "crop off the right side on this photo." Resizing is less important to me than being able to do a quick crop. Is there a way to use KM to achieve this? I can't see a way to use the built-in resize and crop tools to do it, but I'm hoping I'm missing something.

Are you aware that the resize and crop actions in KM accept variables and calculations? This doesn't seem like a difficult problem. Is this what you want to do: (roughly)

  1. For each image in a folder:
    1a. Display it to the user
    1b. Ask the user which sides to crop: top, bottom, left or right
    1c. crop and save

To be honest I haven't saved images much. It might not have the file type options that you want. What file types are you working with? KM supports a few image types but they may not have the same details and parameters that you want.

I do a lot of resizing to specific dimensions with Keyboard Maestro macros but I always crop manually. And those macros call ImageMagick using its Perl library.

My suggestion would be for your macro to first resize the image to cover your requirements (this will make the crops more efficient) and then produce the three possible crops you want. You can quickly preview them to see which one you want to use.

You should certainly be able to use the built-in Keyboard Maestro actions to do all that, calculating the cropped dimensions for each version.

Hope that makes sense.

1 Like

On a different tack, I haven't used macOS Automator in years but I seem to recall it has image processing features also. However the poster seems to want user interaction to help choose which side of the image gets cropped, and I am not sure if Automator can do this. KM can.

1 Like

Thanks for the suggestions. It hadn’t occurred to me that I could display the image than prompt for where I want the crop to happen. But that suggestion prompted me to think through another option — I think I can open an image in a lighter-weight app like Touch/Retouch (which I have through Setapp), then use “Click at Found Image” to select a 3:2 crop ratio. Not instant like I was thinking, but it would speed up the process quite a bit.

Yes, KM has the ability to display an image, at which point you could also ask the user which side he wants to crop. The last time I did this there was a trick required to make it work well, so if you choose to do that, you might need to come back here and ask more questions.