macOS Shortcuts and Person Mask

Talk about Pixelmator Pro, share tips & tricks, tutorials, and other resources.
User avatar

2022-03-22 19:17:44

I am not an advanced Pixelmator Pro user by any means but use Pro for some simple editing and marketing materials.

I noticed the there are a number of macOS shortcuts to use and want to integrate them into my current workflow for sorting, coping and renaming inventory images. The images do not contain a human subject but noticed that the Get Person Mask works pretty well for capturing the subject. My problem its that the Crop to Aspect Ratio or Automatically Crop images actions cut off or shift the subject too far to one side. I am trying to figure out how I can centre the crop around the centre of the Person Mask to maintain the whole subject for use on our website.

Does anyone have any idea on who I can find the coordinate of the center of the Person Mask?

I was thinking I could use the Person Mask to capture the subject, remove the background, trim the transparent pixels and figure out the centre of the image by splitting the width and height.

I would then pad the result with x number of pixels and use the mask to overlay my original image and crop out unwanted space.

Am I looking at this wrong or is there a better way to go about this?

Image

Image
User avatar

2022-03-23 15:05:17

It sounds like you're on the right track. A colleague who worked with Shortcuts integration agrees that there most likely aren't any other/better ways to do this using the Shortcuts app by itself. AppleScript may offer some more possibilities (and you can use Shortcuts to run and combine AppleScripts) but it's a bit difficult to say without having tried something like that for ourselves.