New masking feature: differences between smart-preview and original?

Participant ,
Dec 22, 2021 Dec 22, 2021

Copy link to clipboard

Copied

What happens if I use the new masking with sky or people recognition on mobile, with a low-res smart-preview image?
Will it be recalculated when syncing with the original file to use the full image? Or will I end up with an inferior mask if its done on a smart-review?

TOPICS
Cross-app workflows

Views

197

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 ,
Dec 23, 2021 Dec 23, 2021

Copy link to clipboard

Copied

For most images: neither. The masks that Lightroom creates are not full image size masks anyway. They are about the pixel size of a smart preview. The only exception could be large panoramas, because apparently the mask size is determined from the height of the image, not from the largest side. A smart preview of a panorama image could thus lead to a lower quality mask than the original would.

 

-- Johan W. Elzenga

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
Participant ,
Dec 23, 2021 Dec 23, 2021

Copy link to clipboard

Copied

Still with stuff like hair, leaves and fine detail there must be a difference of creating one on a 40MP original or a smartpreview, so basically its yes, don't do them on smartpreview if you want full detail?

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 ,
Dec 23, 2021 Dec 23, 2021

Copy link to clipboard

Copied


@Wurstkrapfen wrote:

Still with stuff like hair, leaves and fine detail there must be a difference of creating one on a 40MP original or a smartpreview, so basically its yes, don't do them on smartpreview if you want full detail?



Like I said, the masks that Lightroom creates are not full size masks. They are limited to about smart preview size. That is why Lightroom is not very good at creating fine detail masks like hair masks, regardless of whether you use the original or a smart preview. That remains Photoshop territory for now.

 

-- Johan W. Elzenga

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 ,
Dec 23, 2021 Dec 23, 2021

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

"The masks that Lightroom creates are not full image size masks anyway. They are about the pixel size of a smart preview. The only exception could be large panoramas, because apparently the mask size is determined from the height of the image, not from the largest side."

 

Using the hairy dog pic, I exported it as TIFFs at various resolutions and compared the byte sizes of their corresponding Subject masks (stored in <catalog>.lrcat-data):

 

johnrellis_0-1640300006695.png

The last four rows are for a cropped version of the hairy dog:

johnrellis_1-1640300082864.png

The Subject mask for this cropped version appeared very similar to the mask for the original.

 

There's probably some kind of compression used for recording the masks, but the byte size is likely proportional to the uncompressed mask size.

 

Observations:

 

- The masks for the larger images appear to max out at somewhat higher resolution than smart previews, perhaps 25% higher linear resolution.

 

- The masks for the larger cropped versions are about 1.7 times larger than the corresponding uncropped versions of the same height. I don't have any hypotheses about that.

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 ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

@johnrellis Interesting observations! The information I gave about mask sizes is what Adobe engineers have told me. There may be a difference between at what size the mask is initially generated by the AI and at what size it is eventually stored. When the mask is applied, it makes sense that it needs to be the same pixel size as the image. But that does not necessarily mean that it was generated at that size. It could be uprezzed (for speed reasons). Hair masks in Lightroom are still very poor. Far too poor to change a portrait background from a light color to black, for example.

 

-- Johan W. Elzenga

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
Engaged ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

@johnrellis 

Masks are stored in <catalog>.lrcat-data folder.

It's just grayscale tiff with additional header at the beginning.

Tiff can be easily extracted by removing this additinal header if you know what to look for (beginning of tiff image can be easily identified).

If you'll remove this additional header - it's just a standart tiff image.

Masks always have the size of smart previews no matter what's the resolution of original image, 2880px on the long side in my tests.

Also, masks are not stored fully.

Lets say you have a landscape shot with sky on top, land on bottom and horizon somewhere in-between.

When you use "Select Sky" on this image, mask will only contain horizontal strip with the horizon (transition from black to white).

White strip on top (for sky) and black strip on bottom (for land) will not be stored in the mask.

Where to put that strip with transition, and what's below and above it is stored in that additional header.

Same optimization is applied to all AI masks - rectangles of solid black and white at the  borders are removed.

Because of this comparing mask sizes is not fully correct.

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 ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

Excellent information, thanks.

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 ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

"Masks always have the size of smart previews no matter what's the resolution of original image, 2880px on the long side in my tests."

 

Smart previews, at least in my LR, are 2560 pixels.

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
Engaged ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

I investigated this stuff some time ago when LrC 11.0 was released and writing from memory, so not entirely sure - it may be 2560px.

This needs to be verified if this is important ))

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 ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied


@FSt0p wrote:

I investigated this stuff some time ago when LrC 11.0 was released and writing from memory, so not entirely sure - it may be 2560px.

This needs to be verified if this is important ))



I was told that the masks are not exactly smart preview size. The mask has a maximum height (around 2000 pixels, but I do not remember the exact number), not a maximum width. So you could have gotten 2880 pixels. A smart preview has 2560 pixels on the longest side.

 

-- Johan W. Elzenga

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 Employee ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

A Smart Preview is 2560px - long edge max.

An AI Mask is 1920px - short edge max. 

 

Rikk Flohr - Customer Advocacy: Adobe Photography Products

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 ,
Dec 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

LATEST

@Rikk Flohr: Photography Thanks for confirming it, Rikk. That means that a mask in a 2:3 ratio image will be 1920 x 2880 pixels max. Just as I remembered it.

 

-- Johan W. Elzenga

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 ,
Dec 23, 2021 Dec 23, 2021

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]


I was curious about this and did an experiment with a hairy dog. Using an inverted Subject mask to darken the background, I couldn't see any visually noticeable differences between edits made with a smart-preview mask and edits made with the full-resolution original. But there are very small differences that would be noticeable to pixel-peepers.

 

Details

 

I used this 8640 x 5760 .arw (11.4 times as many pixels as a smart preview):

johnrellis_4-1640298082279.png

 

I edited with the smart preview of the photo, made an inverted Subject mask, and set Exposure = -1.5:

johnrellis_5-1640298180444.png

Then I restored the original .arw (using the mask edits created for the smart preview) and exported it as a TIFF.  I repeated the same process with the original .arw, exporting a second TIFF.   That is, one TIFF was exported from the original using the smart-preview mask, and the other TIFF exported using the full-resolution mask.

 

Visually, the two TIFFs look identical. I opened them as layers in Photoshop and blended the layers with Difference. The flattened result looks all black, meaning there's little visual difference between the two:

johnrellis_6-1640298369170.png

I used Levels to exaggerate the differences:

johnrellis_7-1640298439015.png

As expected, they're around the fringes of the dog's fur, most of which are luminance differences of 4/255 or less.

 

Next, I wanted to see how the full-resolution and smart-preview masks themselves compared. So I used the Copy Settings plugin to extract the Subject masks from the .arw and its smart preview as 8640 x 5760 TIFFs:

johnrellis_1-1640297045753.png

 

The extracted TIFFs were the same size as the original (8640 x 5760) (smart previews are 2560 x 1707).  The difference between the layers is visually noticeable, barely (click on the image to see it at full size):

johnrellis_9-1640298800057.png

Flattening and using Levels to exaggerate the differences:

johnrellis_11-1640298939619.png

The luminance differences are 23/255 or less, with most pixels at 6/255 or less.

 

 

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
Contributor ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

Johnrellis, I'm a bit confused.  How do I ensure I always use 'full masks'?

 

I use LRC and do not (deliberately) generate any smart images...that I know of...or need...except if I happen to send to LR Mobile, for some reason, which is getting less and less due to the profile incompatibility with linear profiles.

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 ,
Dec 24, 2021 Dec 24, 2021

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

"How do I ensure I always use 'full masks'?"

 

If you don't use smart previews for editing within LR Classic, you'll always be using the full-resolution masks. You can tell whether you're editing with a smart preview rather than the original via the badge in the upper-right corner of the photo's thumbnail in Library:

johnrellis_0-1640369523030.png

 

That badge will appear if you do Library > Previews > Build Smart Previews and then disconnect the disk holding the original.

 

If you make a Subject or Sky mask while editing a smart preview and then switch back to editing the original (e.g. by reconnecting the disk holding the original), and you want to re-generate a full-resolution mask, you'll have to delete the Subject/Sky mask component and add a new one.

 

But at least with the one example I worked through above, the differences between full-resolution and smart-preview Subject/Sky masks are not visually distinguishable (except to perhaps pixel peepers).

 

If others find examples to the contrary, it would be great to have them posted here.

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