Skip to content

LR-META-XMP: radial masks keep their inside/outside from Lightroom (fixes #1815) - #1817

Merged
echelon merged 1 commit into
storytold:mainfrom
bitshiftza:radial-mask-flipped
Oct 15, 2026
Merged

echelon merged 1 commit into
storytold:mainfrom
bitshiftza:radial-mask-flipped

Conversation

@bitshiftza

Copy link
Copy Markdown
Contributor

Radial masks from Lightroom keep their inside/outside

Fixes #1815

A Lightroom XMP radial mask (+1 EV) before and after: the effect moves from outside the circle to inside, as in Lightroom

Cause

crs_masks.rs read crs:Flipped on a Mask/CircularGradient as LightCraft's invert. Lightroom Classic writes Flipped="true" on an ordinary radial mask, whose effect is inside the circle. Every radial mask imported from a catalog, an XMP sidecar, a DNG's embedded XMP or a .lrtemplate preset therefore came out inverted.

What Lightroom's XMP means

These rules were established by round-tripping synthetic DNGs with known masks through Lightroom Classic 15.6, then rendering Lightroom's rewritten XMP in LightCraft:

Where the radial is Effect inside when Inverting the mask
crs:MaskGroupBasedCorrections, crs:Version 2 (what Lightroom writes today) Flipped="true" crs:MaskInverted on the mask component (already read correctly)
crs:MaskGroupBasedCorrections without crs:Version always: Lightroom ignores Flipped and rewrites it as Flipped="true", Version="2" crs:MaskInverted
crs:CircularGradientBasedCorrections (process-2012 Radial Filter) Flipped="true" ("Invert Mask"); the default is outside n/a

The legacy Radial Filter row follows that filter's documented behaviour, which is outside by default with Invert Mask bringing the effect inside. It isn't measured, since no legacy files were available. The old mapping had it backwards too.

Feather. When Lightroom upgrades a version-less radial it halves Feather (50 → 25, 100 → 50) and renders both the same. So a version-less value is read at half; version 2 values are read as they are. With that, the middle of the fall-off lands within a few percent of the radius of Lightroom's: 0.86 vs 0.87 at feather 25, and 0.73 vs 0.76 at feather 50. The fall-off shape still differs (Lightroom's extends a little past the ellipse edge, ours ends at it); that's a renderer change, left for another time.

Tests

All in crates/engine/src/crs_masks.rs, on synthetic XMP:

  • lightroom_radial_flipped_is_inside renders a grey frame and checks that the centre brightens and the corners don't;
  • lightroom_radial_mask_inverted_is_outside;
  • versionless_group_radial_is_inside_with_half_the_feather;
  • legacy_radial_filter_is_outside_unless_flipped;
  • lrtemplate_radial_filter_reads_flipped, the path presets and catalog import share;
  • the existing corrections_become_masks now expects Flipped="true" to mean inside.

All of them fail without the fix.

…ixes storytold#1815)

crs:Flipped="true" is how Lightroom Classic writes an ordinary radial mask
(effect inside); it was read as our invert, so every imported radial applied
outside the circle. Established from Lightroom Classic 15.6's exports of
synthetic DNGs:

- MaskGroupBasedCorrections, Version 2: Flipped is the effect-inside flag;
  inverting is the component's MaskInverted.
- MaskGroupBasedCorrections without Version: inside whatever Flipped says
  (Lightroom rewrites both values as Flipped=true, Version=2), and its Feather
  is halved, as Lightroom rescales it on that upgrade.
- Legacy CircularGradientBasedCorrections Radial Filter: outside by default,
  Flipped=true (Invert Mask) is inside.

One mapping serves XMP sidecars, DNG-embedded XMP, presets and .lrcat catalog
import. LightCraft writes no crs: masks, so there is no writer to match.
bogusyogi added a commit to Orthic-Labs/ember that referenced this pull request Oct 15, 2026
…/outside (upstream storytold#1817, fixes upstream storytold#1815)

Applied from storytold/lightcraft PR storytold#1817 (open upstream, not yet merged); docs rebranded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon
echelon merged commit 5e1a951 into storytold:main Oct 15, 2026
@echelon

echelon commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thank you @bitshiftza! This landed on main in integration batch 36 (#1843).

If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lightroom import: radial masks are applied outside the circle (crs:Flipped read as invert)

2 participants