John_R_Ellis's profile
Champion

Champion

 • 

6K Messages

 • 

103.4K Points

Thu, May 13, 2021 4:48 AM

6

Lightroom: Correct copying of crops and local adjustments of Virtual Copies

Lightroom has long incorrectly copied crops and local adjustments between photos with different orientations. LR 10.2 tried unsuccessfully to fix that but broke copying between originals and virtual copies. This memo provides consistent principles of how copying should behave, test results of the current broken behavior, and a guide to implementing correct behavior.
 
Since this memo spans a number of bug reports about different symptoms, it shouldn't be merged with any one of them.
 
How Copying Crops and Adjustments Should Behave
 
Users almost always place crops and local adjustments relative to the photo's content. A Spot Removal is placed over a blemish on a face; an Adjustment Brush lightens the shadows under eyes; a crop is placed tightly around a face; a Graduated Filter darkens the sky.
 
So if a user copies a crop or local adjustment from a raw to a TIFF produced from that raw by Photoshop, the user expects the adjustment to appear in the exact same visual position and have the same effect. A Graduated Filter aligned with the horizon in the raw should also be aligned with the horizon in the TIFF; a Spot Removal applied to a face blemish in the raw should be located on that blemish in the TIFF.
 
Similarly, if a user copies a local adjustment from an original to a cropped virtual copy, the user expects the adjustment to appear in same position relative to the content of the photo, e.g. an Adjustment Brush applied under the eyes should appear under the eyes in the cropped virtual copy.
 
The Problems
 
Prior to LR 10.2, when crops and local adjustments were copied between photos with different orientations (e.g. a photo rotated in-camera and a TIFF created by editing that photo in Photoshop), the crops and adjustments appear at the wrong sizes and positions.
 
LR 10.2 tried to fix that. Crops now copy correctly between different orientations, but Graduated Filters and Adjustment Brushes only work when the target photo has had its metadata saved to disk, and Spot Removals and Radial Filters don't work at all.  And if the source or target photos have been cropped, copying local adjustments doesn't work.



Worse, 10.2 broke copying local adjustments from originals to cropped virtual copies (which necessarily have the same orientation), with the adjustments ending up in the wrong size and position. (Recently, the development team decided that new behavior of 10.2 with cropped virtual copies was "by design", not a bug. I hope this memo will persuade them differently.)
 
Finally, when LR 10.2 copies Spot Removals from an original to a virtual copy, the source of the clone can shift in position significantly, even when the virtual copy is uncropped.
 
Testing LR
 
I've done extensive testing of copying crops and local adjustments with numerous combinations of orientation, cropping, and virtual copies, and only a few combinations work correctly (see the table below). 
 
I used four versions of a JPEG photo that was originally landscape, with EXIF Orientation = Horizontal and internal LR orientation = "AB". Visually, all three appear as portrait in LR.
 
- "normal" is a version of the photo rotated clockwise in LR, edited in Photoshop, and saved as a JPEG. It has EXIF Orientation = Horizontal and internal LR orientation = "AB".
 
- "rotated" is a version of the photo rotated clockwise in LR. It's internal LR orientation is "BC".
 
- "rotated saved" is "rotated" with its metadata saved with Metadata > Save Metadata To File.
 
- "cropped VC" is a cropped virtual copy of the source or destination photo.
 
Each row of the table below represents the results of copying a Crop, Spot Removal (Clone), Graduated Filter, Radial Filter, and Adjustment Brush from the source photo to the destination photo. Y indicates correct copying, N incorrect copying.
 
For example, here are the test results for the first two rows, copying "normal" to "rotated" and "normal to "rotated saved":

 
Counter-clockwise on "normal" are a Radial Filter, Graduated Filter, Adjustment Brush, and Spot Removal (clone). Only the Graduated Filter and Adjustment Brush copy correctly, to "rotated saved". (The crop test isn't shown.)

Implementing the Desired Behavior
 
Implementing the desired behavior is straightforward, requiring elementary coordinate transformations from the source to destination photos. I've implemented these transformations for my Any Crop and Any Filter plugins, and I've posted a shorter description a couple years ago.
 
Internally, LR represents a photo as an underlying image (an array of pixels) and an "orientation", which specifies how much the underlying image should be rotated (0, 90, 180, 270 degrees) and whether it should be mirrored to display it visually. Rotating or flipping an image in LR changes just the orientation. But when you edit a photo in Photoshop, it actually rotates and mirrors the pixels in the underlying image as specified by the orientation, and the saved TIFF will then have an orientation with no rotation or mirroring.
 
LR represents the coordinates of crops and local adjustments with values in [0..1], where (0, 0) represents the upper-left corner of the underlying image before any orientation (rotation and mirroring) has been applied.  Call this coordinate system the underlying-pixels coordinates. Call the coordinate system after the orientation has been applied the visible-pixels coordinates.
 
Prior to LR 10.2, when LR copied crops and local adjustments, it simply copied their underlying-pixel coordinates, which produces the wrong results when the source and target have different orientations.
 
When copying, LR should instead translate the underlying-pixel coordinates of the adjustments in the source image to visible coordinates. Then it should translate those visible coordinates to the underlying pixel coordinates of the target photo.
 
LR 10.2 apparently tries to do something like this but gets it wrong in several ways:
 
- It doesn't transform the coordinates for Spot Removals or Radial Filters.
 
- It gets the target photo's orientation from its saved metadata rather than the current catalog setting.
 
- It appears to use visible-pixel coordinates that are relative to the photo after any crop has been applied as well as orientation. Instead, it should use visible-pixel coordinates that are relative to the orientation but not the crop. That will ensure, for example, that a Spot Removal is applied to the exact same part of the photo even if the target or source or both are cropped.

Responses

Adobe Administrator

 • 

10.7K Messages

 • 

141.9K Points

2 m ago

@John_R_Ellis 

Thanks for the detailed report - it shows a lot of work and thought on your part. 

A few of the items in this list are active bugs scheduled for upcoming releases. It might be better to revisit this list after those are fixed to see what remainder we have that qualify for behavior change requests. 

Also keep in mind that some recent behavior changes are being made in conjunction with yet-to-be-released features that can't be discussed yet.

Champion

 • 

6K Messages

 • 

103.4K Points

Good                .

Champion

 • 

1.7K Messages

 • 

29.6K Points

aren't you all putting the cart before the horse? Why would you choose to break workflows months and months before a new feature is released? Countless professionals use Classic to get their jobs done and now they have a much harder time doing so because the software is no longer working as expected. 
Is this going to be the new standard moving forward? 

(edited)

33 Messages

 • 

766 Points

Of course it will be the new standard (and has been for some time). It's all about them moneyzzz.

Champion

 • 

6K Messages

 • 

103.4K Points

1 m ago

I've constructed a semi-automated test suite for Copy / Synchronize Settings that can be run with about 15 minutes of effort:
https://www.dropbox.com/s/a10d49qc1m6c1f2/Copy%20Settings%20test%20suite.2021.06.24.zip?dl=0 

The unzipped folder contains a _README.txt detailing how to run the suite and summarize the results in Excel.

The suite generalizes the results I presented above, testing combinations of rotation, cropping, and mirroring in the source and target photos, both unsaved and saved to metadata.

In the table below, the Source and Target representations are:

N - the photo is in normal orientation, with no rotation or mirroring (orientation AB)
C - same as N but with a crop applied, including a crop angle
R - the photo has been rotated clockwise (orientation BC)
RC - the photo has been rotated clockwise, with the same crop as C applied
RCM - the photo has been rotated clockwise and mirrored (flipped horizontal), with the same crop as C applied (orientation CB)

The adjustments tested are:

Crop -  a crop with a crop angle
Spot - a spot removal using Clone, with the source automatically selected
Graduated - a graduated filter, at angle
Radial - a radial filter, at angle
Up-Mode - Transform > Auto, copying Upright Mode
Up-Transforms - Transform > Auto, copying Upright Transforms
Tr-Adjustments - copying manual Transform adjustments

Some new observations: Copying Transform settings between different orientations doesn't work at all. Copying Transform > Auto with Upright Mode doesn't even work between photos with the same orientation!

Champion

 • 

2.4K Messages

 • 

39K Points

1 m ago

Great job John! Just as an FYI to everyone I first reported this issue in a post three years ago, which was merged to a newer post. So I can confirm this is at least a three year old problem, which remains uncorrected in LrC 10.3.

https://feedback.photoshop.com/conversations/lightroom-classic/lightroom-classic-synccopying-a-local-adjustspotcrop-results-in-wrong-size-and-position/5f5f46214b561a3d42751770?commentId=607dda9e3b0a051eac332ed9

Champion

 • 

6K Messages

 • 

103.4K Points

25 d ago

I released the Copy Settings plugin, which correctly copies local adjustments, spot removals, transforms, and crops between photos. It also lets you define presets for which settings should be copied.  I'm hoping that Adobe will fix all the bugs with Copy/Synchronize Settings soon, but meanwhile, this plugin will get the job done.

The code that translates Develop settings from one photo orientation to another is just over 400 lines, and I've made it available here:

https://www.dropbox.com/s/vv4i6nr1z5h22a5/copy-settings.2021.06.29.lua?dl=0 

And below are the test results for the plugin.  Like the built-in Copy/Synchronize Settings commands, the plugin can't correctly copy Transform > Upright Mode and Upright Transforms -- I wasn't able to figure out how to work around the bugs. The plugin can copy Transform Adjustments in many but not all cases:

33 Messages

 • 

766 Points

@John_R_Ellis 

[s] this is clearly impossible, you couldn't have done it on your own if the whole LR team and QA haven't managed to prioritize and nail it for so long. Please do not make us believe in unimaginable !!! [/sarcasm]

Thank you and great work as always, have been a happy user of some of your plugins!

8 Messages

 • 

146 Points

@John_R_Ellis 

Hi John,

On my first synchronise I get this error:

An Internal Error Has Occurred:

CopySettings.lua:448: attempt to concatenate field 'y' (a nil value)

I tried doing a synchronise first which brought up this error. I then tried copying and pasting settings which came up with the same error.

Am I doing something wrong?

Champion

 • 

6K Messages

 • 

103.4K Points

Hi Colin, this is clearly a bug (probably an internal representation of a Develop setting from an older version of LR that I didn't catch).  Please send an email to my support address so I can can get some details and I'll fix it asap.  (My standard policy is to provide complimentary licenses to anyone who first reports a reproducible bug.) Thanks.

33 Messages

 • 

766 Points

Dear Adobe, read and learn from the post above, this is how the business is done.

Champion

 • 

1K Messages

 • 

15.9K Points

25 d ago

I have a friend that used to use the Upright Mode and Upright Transform Syncing, Copying etc but pretty much gave up on these bugs being fixed after all this time. It should be embarrassing to Adobe to leave this unfixed for so long considering the issues are totally repeatable and easily duplicated.

2 Messages

 • 

70 Points

10 d ago

The fact that we can't sync or copy settings across differently cropped Virtual copies or snapshots is gravely damaging my workflow and it making me loose time and money.

This needs to be fixed.

2 Messages

 • 

70 Points

10 d ago

Being unable to copy, sync local adjustments across differently cropped versions/virtual copies/snapshots of the same photo is gravely damaging my work.

I am loosing time, money.

Adobe Administrator

 • 

10.7K Messages

 • 

141.9K Points

2 d ago

@John_R_Ellis  I've been hammering on the team and we have a bug filed and are working on resolution. 

Champion

 • 

6K Messages

 • 

103.4K Points

Very good          . 

8 Messages

 • 

146 Points

I love John's plug in! It takes Lightroom syncing to the next level introducing PRESETS. Which is even more time saving.

(edited)