Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Can I export masks from Lightroom Classic?

New Here ,
Nov 15, 2021 Nov 15, 2021

Copy link to clipboard

Copied

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

TOPICS
SDK, Windows

Views

384

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 15, 2021 Nov 15, 2021
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. https://community.adobe.com/t5/lightroom-classic-discussions/subject-sky-masks-need-to-be-updated-whenever-i-reopen-a-project/td-p/12524134

Likes

Translate

Translate
LEGEND ,
Nov 15, 2021 Nov 15, 2021

Copy link to clipboard

Copied

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.

 

https://community.adobe.com/t5/lightroom-classic-discussions/subject-sky-masks-need-to-be-updated-wh...

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 15, 2021 Nov 15, 2021

Copy link to clipboard

Copied

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:

  • Import image
  • Create mask one with select subject
  • Duplicate mask one to create mask two
  • Invert mask two to mask the background
  • Mask one (object) - over expose until completely white
  • Mask two (background) - under expose until completely black
  • Export the image -> convert to suitable basic black white image

 

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.

 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

"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:

https://developer.adobe.com/console/servicesandapis 

 

See here for hints about getting started:

https://community.adobe.com/t5/lightroom-classic-discussions/sample-code-for-a-publish-service/m-p/7...

 

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:

https://www.dropbox.com/s/jxljket1zpymase/showmetadata.1.4.zip?dl=0 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines