We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
I am currently working on a photogrammetry project and need to mask 750+ photos. I saw a demonstration of the "Select Subject" masking available in Adobe Lightroom and was very impressed. Question is, can one export the mask?
In addition, I'm hoping to automate this process as much as possible. Is scripting available with Adobe Lightroom? Or will I have to make my own plug-in to achieve such a thing?
I'm hoping to:
- load in images
- apply "Select Subject" to images
- export masks for images
From another members issue, where the member applied a AI mask ( select sky in that case) from one photo to many photos, the member found that in each photo the mask had to be recomputed.
So, apparently not.
Fantastic, thanks for the lead.
I'm suspecting that I might have to get familiar with the automation side of Adobe Lightroom and "hack" my way to export a mask. I've found a suitable pipeline:
The resulting black and white pattern can be used in photogrammetry and would make a lot of people very happy! Now I need to figure out how to automate such a process with Adobe Lightroom.
"Is scripting available with Adobe Lightroom? Or will I have to make my own plug-in to achieve such a thing? I'm hoping to: - load in images; - apply "Select Subject" to images; - export masks for images"
You can download the Lightroom Classic SDK for plugins from here:
See here for hints about getting started:
I've just started looking at how LR represents the Select Subject/Sky masks. Unlike the other mask types, their pixel coordinates aren't exposed through the SDK API -- they're stored in the .lrcat-data subfolder of the catalog folder as binary .dat files, and I haven't seen any information yet about their format.
So I wouldn't waste time learning the SDK until you can figure out the representation of the masks. You might find the free Show Catalog Metadata plugin helpful for examining all of the other mask settings:
I discovered a way to export a Sky or Subject mask as a bitmap. Outline:
1. Create an all-white TIFF that same pixel dimensions as the photo containing the mask.
2. Use Sync Settings to copy the mask from the photo to the TIFF.
3. Use the SDK to copy the field MaskDigest from the photo's develop settings to the TIFF's settings.
4. On the TIFF, set the mask's Exposure = -4.
5. Use the Tone Curve to adjust the black level.
6. Export the TIFF.
If it turns out to be too much of a challenge in Lightroom, will it work to do this job in Photoshop instead? Because Select Subject started in Photoshop, Photoshop has more control over masks, and Photoshop is scriptable.