You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default raw tone curve is flatter than Lightroom's (shadows ~1 EV brighter, contrast slope ~1.0 vs ~1.46) #146
Found while investigating #138. Compared with Lightroom's default rendering (via each file's embedded preview), LightCraft's standard raw tone curve renders shadows and midtones about 1–1.2 EV brighter and highlights dimmer; the log-domain contrast slope is ~1.0 vs ~1.46. The same gap shows on CC0 Canon 5D3 DNGs, CR2 and NEF samples — it's product-wide (tracked as LR-BEHAV-RENDER-FIDELITY in docs/parity.md), not DNG-specific, and it's what users describe as "washed out / like LOG".
Proposal: retune the default base tone toward a camera-like S-curve (steeper toe, ~1.3–1.5 midtone contrast), measured against the planned render-fidelity suite rather than by eye. This changes the look of every existing raw edit, so it needs a maintainer decision (e.g. versioned process defaults so existing edits keep their look).
My primary evaluation case is interior remodel RAWs intended for contractor portfolios. The target is a bright, crisp rendering with visible material texture and local contrast, while retaining detail in practical lights and windows. White balance and color-cast correction need to keep cabinet, stone, tile, and paint colors believable. A flatter/brighter shadow lift alone can make the room look washed out, and warmth should not be used to mask a camera WB error. It would help to include this kind of mixed-light architectural scene in the render-fidelity suite, with highlight clipping and fine-detail retention measured as well as tone-curve similarity.
A data point for this, from DNGs specifically, plus a narrower option that doesn't change the global default.
I ran main (2472021) over every CC0 DNG on raw.pixls.us and compared each render with the camera's own embedded JPEG (camera- and phone-written DNGs only; DNGs written by Adobe software are left out as references). Of 60 DNGs that carry a colour matrix, the 53 without a ProfileToneCurve are clearly darker in the mid-tones than their camera JPEG: a camera mid-grey of L* 65 comes out at L* 50 (median ΔE76 12.7, ΔL* −7.9). The 7 with a ProfileToneCurve match well (ΔE 6.4, ΔL* +0.5), and so do raws where the camera look is fitted (ARW/NEF/RW2, ΔE 3.8). The matrices and levels look fine; once the lightness is mapped, the error drops to about 6. So for these files it's the tone curve.
Narrower option: for DNGs that have a file matrix but no ProfileToneCurve, fit only the tone curve to the file's own preview, through the same fit and held-out gates the camera look already uses, and keep the file's matrix. In a local experiment that was accepted on 46 of 53: camera DNGs went from ΔE 12.2 to 3.7, phone DNGs from 11.4 to 6.3 (phone previews are small and locally tone-mapped, so tone only roughly matches there). The global default curve, other formats and DNGs with their own tone curve stay as they are.
It does change how those DNGs look, including ones already edited, so I'd rather ask first: would you take this as a separate PR (I have it in progress locally, with a cache bump and tests), or should it wait for the decision here on versioned process defaults?
I've spent the last three weeks on a personal project that does one narrow part of this: a raw developer for a single camera (Sony A7CR) whose default rendering and Basic sliders are tuned to match Lightroom 9.5.1 (Camera Raw 18.5.1, process version 2012, Adobe Color) measured as a black box. It's a Swift/Metal app, so there's no code to share, but the measurements may save this issue (and #196) a lot of time. Everything below comes from Lightroom's exported output only: XMP sidecars in, 16-bit TIFFs out. Nothing is read from Adobe's files.
What the Basic sliders do, measured
Exposure is a pure 2^EV gain applied before the tone curve. It matched to within 0.0002 stop on a controlled ramp. Applying the gain after the curve reaches only about 80% of Lightroom's response.
Contrast is a fixed per-channel curve, not scene-adaptive. Its response varies only 3 to 25% across 24 photos away from the pivot, and Contrast 25 and 50 are the Contrast 100 response scaled.
Blacks and negative Whites are fixed curves. Positive Whites stretches toward a white point taken from the photo's 99th percentile: at +100, w = 1.394 × p99 − 0.553 (r 0.95). The strength scales with (amount/100)^1.85.
Highlights (negative) behaves like a darkening applied before the base curve, exactly proportional to the slider. From each pixel's −100 result, a pull of 0.10/0.25/0.50/0.75 of it predicts −10/−25/−50/−75 to 0.001 to 0.007 stop. It is local and edge-aware, so texture keeps its contrast; a global curve cannot reproduce it. Its strength depends mostly on how much of the frame is dark, and how dark: on one window crop, raising dark coverage from 10% to 90% made the pull 4.35× stronger. The brightness of the pixel being darkened matters only through the curve. Exposure clamps at the top of the base curve; Highlights doesn't, so pixels above white stay recoverable.
Shadows (positive) is a gain in stops that grows exponentially with the amount and depends on the photo's own statistics. It also needs spatial context.
Combinations: Shadows, Whites and Blacks add up. Highlights and Shadows dampen each other, each keeping about 0.75 to 0.87 of its solo effect when the other is set.
Profile-dependent: with Adobe Standard/Adobe Color there is also an automatic dark-content lift that depends on the frame's darkest region. It is switched by the profile's default black rendering, so it may not belong in a clean-room base curve.
I'm one person with one camera and one profile. The tone operators are probably camera-independent, but I haven't tested that.
LightCraft 0.4.0 on the same photos. Three A7CR photos, Lightroom's default against LightCraft's Color profile, CIELab D65 at 1600 px:
Sky
Dome
Sun
Mean ΔE76, whole frame
2.95
2.19
10.59
Mean ΔE76, where Lightroom's L* > 70
2.19
4.27
20.45
On the sun photo, LightCraft's bright regions are about 20 L* darker than Lightroom's. That supports this issue's "highlights dimmer" reading: most of the gap is the starting look, not the Highlights slider. Fitting LightCraft's own sliders per photo gets very close (sky ΔE76 3.9 → 0.5), but the fitted settings don't carry over to other photos.
Measurement setup. The references stay local, as plan/ does: recipes are written as XMP sidecars, Lightroom exports 16-bit sRGB TIFFs with sharpening and noise reduction at zero, and results go into a content-addressed store. One trap worth knowing: on the same inputs, Lightroom produces one of two repeatable outputs depending on its state, so each batch includes sentinel files to show which state it ran in. Metrics are log2 linear luminance in stops for tone and CIELab/Oklab for colour; I don't compare encoded RGB.
Is fitting LightCraft's own operators to Lightroom's exported output acceptable under the clean-room rules, as this issue proposes? It's black-box measurement only, with no Adobe files, values or profiles in the repo. That decides whether the next steps are welcome.
An independent data point for this, on a DNG (where no file-local tone fit applies):
File: Ricoh GR III DNG, CC0 from raw.pixls.us. It has BaselineExposure = −0.51 and no ProfileToneCurve, so it gets the default tone curve.
Method: default render, long edge 768 px, luminance percentiles 10/25/50/75/90 of the central 80 % of the frame, compared with the camera JPEG embedded in the DNG. Values are camera − render in EV (positive = render darker than the camera JPEG).
So the shadows match but midtones and highlights are ~1–1.25 EV too dark: the curve is too flat, matching the slope finding above rather than a plain exposure offset. (For the raws with the camera-JPEG fit — ARW, CR2, CR3, NEF, RAF from the same set — the same measurement stays within 0.3 EV at the median (within 0.05 EV for four of the five), as expected, since the fit uses that JPEG.)
Question: until the default curve is retuned, would it make sense to let DNGs without a ProfileToneCurve use the same guarded camera-JPEG tone fit as the other raws?
Measurement script and images available if useful.
A data point from Leica DNGs, and a working version of the narrower option @radialmonster described above, scoped to Leica for now.
Measured on main (b70ae17): 1200 px renders against each file's own embedded camera JPEG, L* percentiles.
7 LEICA M11-P photos of my own (ISO 64, Summilux-M 35; coast, mangroves, cacti): 99th percentile 61–79 against the camera's 84–96, standard deviation of L* 12–22 against 22–33. They look grey and flat next to the camera JPEG.
CC0 samples from raw.pixls.us: the median sits 13.5 (CL), 10.0 (M10), 9.5 (Q2), 9.3 (SL) and 0.9 (Q Typ 116) L* below the camera JPEG.
All of them carry ColorMatrix1/2 but no ProfileToneCurve, so they get the generic tone map.
What the branch does (fit_dng_tone in camera_preview.rs): DNGs whose Make starts with LEICA, with colour matrices but no ProfileToneCurve and no ProfileGainTableMap, and whose preview was written by the camera, take only the tone and chroma curves fitted to the embedded camera JPEG. "Written by the camera" means no PreviewApplicationName, so previews that Lightroom's "Update DNG Previews" rewrote, edits included, are left alone. The fit goes through the existing partial-look gates (fit_partial_on without learning a matrix). The DNG's matrices and absolute white balance stay. It reads the smallest embedded JPEG that covers the proxy: the M11 stores 160, 720 and 2112 px previews next to a 60 MP one, so this takes about 20 ms per decode instead of about 210 ms. Phone DNGs are left out on purpose, because their previews carry local tone mapping (the DRO problem again).
Result:
The median is within 1.4 L* of the camera JPEG on CC0 CL, M10, Q, Q2 and SL.
On the M11-P set the 99th percentile is within 1.3 L*.
The M9 and M (Typ 240) samples have no usable preview (an uncompressed thumbnail, and a 160 px 4:3 one) and are unchanged.
What remains: the darkest 1 % stays 3–7 L* lighter than the camera, and shadow-heavy, finely detailed scenes stay 4–6 L* lighter at the median. The cause is not established.
@radialmonster, your local version covers all camera and phone DNGs. I'm happy to fold the Leica-specific parts into your PR instead of opening a second one: the converter-preview check, the smallest-preview pick and the CC0 numbers. Or I can open mine as the narrow Leica-only step. Whatever the maintainers prefer.
It changes the starting look of Leica DNGs that were already edited. I bumped LOOK_VERSION to 3 and the render cache to 43, and DNG smart previews are refreshed like those of the per-file look. Is that enough, as for earlier fit changes, or does this need a process version?
@ingolfteetz@PiMinusMax three of us have now landed on the same fix, so let's make it one PR rather than competing ones.
For comparison, the branch I mentioned above (dng-tone-fit, not opened yet) fits the tone and chroma curves to the embedded camera JPEG for any DNG that has a colour matrix and no ProfileToneCurve. It goes through the same held-out gates and keeps the file's matrix and white balance. On raw.pixls.us it accepted 75 of 89 eligible DNGs, and the median ΔE76 against the camera JPEG went from 12.7 to 4.1 (ΔL* −8.4 → +0.1). The others render pixel-identically.
@ingolfteetz's version adds two things mine lacks, and both should be in the merged version:
Origin check: it fits only when the preview was written by the camera (no PreviewApplicationName), instead of my check of the Software tag. Theirs is the better test: an "Update DNG Previews" rewrite carries edits.
Speed: it reads the smallest embedded JPEG that covers the proxy (about 20 ms instead of about 210 ms on the M11).
The open questions are scope and phones. Leica-only is safe but leaves the other camera DNGs (Ricoh GR, Pentax, Hasselblad, …) at ~1 EV too dark. Phone previews are locally tone-mapped, which matches what I saw: phones only improved 11.4 → 6.3. I'd go for all camera-written DNGs, phones excluded (Make/Model, or a ProfileName/Software heuristic), with both of the improvements above.
@ingolfteetz, if you're happy to widen yours to that scope, I'll close my branch and add my 89-file numbers to your PR. Otherwise I can rebase mine with your two guards. @echelon, whichever you prefer, and whether this should wait for the versioned-defaults decision here.
On the versioned-defaults question: process versions landed in this morning's batch (#533). Settings saved without a process read as V1, while new photos and Reset get the latest process. A new tone model branches in finish::base_tone (docs/process-versions.md). So a DNG tone fit could ship without changing DNGs that were already edited: add a Process::V2 whose arm uses the DNG's fitted curve, and keep V1's arm as it is, ignoring a curve that came from a DNG fit (for example via a flag on SourceInfo). The ARW and NEF look changes so far shipped with LOOK_VERSION and render-cache bumps instead, so it's for @echelon to say which this one should use.
@ingolfteetz, if you're happy to widen yours to that scope, I'll close my branch and add my 89-file numbers to your PR. Otherwise I can rebase mine with your two guards. @echelon, whichever you prefer, and whether this should wait for the versioned-defaults decision here.
@radialmonster if you do not mind, do a rebase on your side, I have a bit of a time problem the next days. Anyway happy to contribute now and in the future.
@ingolfteetz no problem, thanks! I'll rebase mine onto main with both of your guards (the PreviewApplicationName origin check and the smallest covering preview), credit you in the commit, and post the 89-file numbers on the PR when it's up.
@ingolfteetz the rebase is up as #807, with your two guards credited in the commit. It now covers any camera DNG with a colour matrix and no ProfileToneCurve or gain table map, and leaves phones out. On the raw.pixls.us DNGs with a camera JPEG, 62 of 73 eligible files are fitted, and median ΔE76 against the camera JPEG goes from 12.2 to 3.2 with none worse. The other files render byte-identically to main. @echelon it bumps LOOK_VERSION to 3 like the other three PRs, so whichever lands later takes the next number.
Activity
foxandbrand commentedon Oct 6, 2026
My primary evaluation case is interior remodel RAWs intended for contractor portfolios. The target is a bright, crisp rendering with visible material texture and local contrast, while retaining detail in practical lights and windows. White balance and color-cast correction need to keep cabinet, stone, tile, and paint colors believable. A flatter/brighter shadow lift alone can make the room look washed out, and warmth should not be used to mask a camera WB error. It would help to include this kind of mixed-light architectural scene in the render-fidelity suite, with highlight clipping and fine-detail retention measured as well as tone-curve similarity.
radialmonster commentedon Oct 8, 2026
A data point for this, from DNGs specifically, plus a narrower option that doesn't change the global default.
I ran main (2472021) over every CC0 DNG on raw.pixls.us and compared each render with the camera's own embedded JPEG (camera- and phone-written DNGs only; DNGs written by Adobe software are left out as references). Of 60 DNGs that carry a colour matrix, the 53 without a
ProfileToneCurveare clearly darker in the mid-tones than their camera JPEG: a camera mid-grey of L* 65 comes out at L* 50 (median ΔE76 12.7, ΔL* −7.9). The 7 with aProfileToneCurvematch well (ΔE 6.4, ΔL* +0.5), and so do raws where the camera look is fitted (ARW/NEF/RW2, ΔE 3.8). The matrices and levels look fine; once the lightness is mapped, the error drops to about 6. So for these files it's the tone curve.Narrower option: for DNGs that have a file matrix but no
ProfileToneCurve, fit only the tone curve to the file's own preview, through the same fit and held-out gates the camera look already uses, and keep the file's matrix. In a local experiment that was accepted on 46 of 53: camera DNGs went from ΔE 12.2 to 3.7, phone DNGs from 11.4 to 6.3 (phone previews are small and locally tone-mapped, so tone only roughly matches there). The global default curve, other formats and DNGs with their own tone curve stay as they are.It does change how those DNGs look, including ones already edited, so I'd rather ask first: would you take this as a separate PR (I have it in progress locally, with a cache bump and tests), or should it wait for the decision here on versioned process defaults?
AlexChambers commentedon Oct 9, 2026
I've spent the last three weeks on a personal project that does one narrow part of this: a raw developer for a single camera (Sony A7CR) whose default rendering and Basic sliders are tuned to match Lightroom 9.5.1 (Camera Raw 18.5.1, process version 2012, Adobe Color) measured as a black box. It's a Swift/Metal app, so there's no code to share, but the measurements may save this issue (and #196) a lot of time. Everything below comes from Lightroom's exported output only: XMP sidecars in, 16-bit TIFFs out. Nothing is read from Adobe's files.
What the Basic sliders do, measured
I'm one person with one camera and one profile. The tone operators are probably camera-independent, but I haven't tested that.
LightCraft 0.4.0 on the same photos. Three A7CR photos, Lightroom's default against LightCraft's Color profile, CIELab D65 at 1600 px:
On the sun photo, LightCraft's bright regions are about 20 L* darker than Lightroom's. That supports this issue's "highlights dimmer" reading: most of the gap is the starting look, not the Highlights slider. Fitting LightCraft's own sliders per photo gets very close (sky ΔE76 3.9 → 0.5), but the fitted settings don't carry over to other photos.
Measurement setup. The references stay local, as
plan/does: recipes are written as XMP sidecars, Lightroom exports 16-bit sRGB TIFFs with sharpening and noise reduction at zero, and results go into a content-addressed store. One trap worth knowing: on the same inputs, Lightroom produces one of two repeatable outputs depending on its state, so each batch includes sentinel files to show which state it ran in. Metrics are log2 linear luminance in stops for tone and CIELab/Oklab for colour; I don't compare encoded RGB.Questions for @echelon
docs/page with the findings above, in more detail, help? I could then follow with a measured base-curve change behind a process version (see PR LRC-DEV-PROCESS: process versions, so a look change can ship without changing existing edits (#146) #533), so existing edits keep their look.LRC-DEV-PROCESS: process versions, so a look change can ship without …
PiMinusMax commentedon Oct 10, 2026
An independent data point for this, on a DNG (where no file-local tone fit applies):
File: Ricoh GR III DNG, CC0 from raw.pixls.us. It has
BaselineExposure = −0.51and noProfileToneCurve, so it gets the default tone curve.Method: default render, long edge 768 px, luminance percentiles 10/25/50/75/90 of the central 80 % of the frame, compared with the camera JPEG embedded in the DNG. Values are camera − render in EV (positive = render darker than the camera JPEG).
So the shadows match but midtones and highlights are ~1–1.25 EV too dark: the curve is too flat, matching the slope finding above rather than a plain exposure offset. (For the raws with the camera-JPEG fit — ARW, CR2, CR3, NEF, RAF from the same set — the same measurement stays within 0.3 EV at the median (within 0.05 EV for four of the five), as expected, since the fit uses that JPEG.)
Question: until the default curve is retuned, would it make sense to let DNGs without a
ProfileToneCurveuse the same guarded camera-JPEG tone fit as the other raws?Measurement script and images available if useful.
ingolfteetz commentedon Oct 10, 2026
A data point from Leica DNGs, and a working version of the narrower option @radialmonster described above, scoped to Leica for now.
Measured on main (b70ae17): 1200 px renders against each file's own embedded camera JPEG, L* percentiles.
All of them carry
ColorMatrix1/2but noProfileToneCurve, so they get the generic tone map.What the branch does (
fit_dng_toneincamera_preview.rs): DNGs whoseMakestarts with LEICA, with colour matrices but noProfileToneCurveand noProfileGainTableMap, and whose preview was written by the camera, take only the tone and chroma curves fitted to the embedded camera JPEG. "Written by the camera" means noPreviewApplicationName, so previews that Lightroom's "Update DNG Previews" rewrote, edits included, are left alone. The fit goes through the existing partial-look gates (fit_partial_onwithout learning a matrix). The DNG's matrices and absolute white balance stay. It reads the smallest embedded JPEG that covers the proxy: the M11 stores 160, 720 and 2112 px previews next to a 60 MP one, so this takes about 20 ms per decode instead of about 210 ms. Phone DNGs are left out on purpose, because their previews carry local tone mapping (the DRO problem again).Result:
Questions before I open a PR:
LOOK_VERSIONto 3 and the render cache to 43, and DNG smart previews are refreshed like those of the per-file look. Is that enough, as for earlier fit changes, or does this need a process version?radialmonster commentedon Oct 10, 2026
@ingolfteetz @PiMinusMax three of us have now landed on the same fix, so let's make it one PR rather than competing ones.
For comparison, the branch I mentioned above (
dng-tone-fit, not opened yet) fits the tone and chroma curves to the embedded camera JPEG for any DNG that has a colour matrix and noProfileToneCurve. It goes through the same held-out gates and keeps the file's matrix and white balance. On raw.pixls.us it accepted 75 of 89 eligible DNGs, and the median ΔE76 against the camera JPEG went from 12.7 to 4.1 (ΔL* −8.4 → +0.1). The others render pixel-identically.@ingolfteetz's version adds two things mine lacks, and both should be in the merged version:
PreviewApplicationName), instead of my check of theSoftwaretag. Theirs is the better test: an "Update DNG Previews" rewrite carries edits.The open questions are scope and phones. Leica-only is safe but leaves the other camera DNGs (Ricoh GR, Pentax, Hasselblad, …) at ~1 EV too dark. Phone previews are locally tone-mapped, which matches what I saw: phones only improved 11.4 → 6.3. I'd go for all camera-written DNGs, phones excluded (Make/Model, or a
ProfileName/Softwareheuristic), with both of the improvements above.@ingolfteetz, if you're happy to widen yours to that scope, I'll close my branch and add my 89-file numbers to your PR. Otherwise I can rebase mine with your two guards. @echelon, whichever you prefer, and whether this should wait for the versioned-defaults decision here.
AlexChambers commentedon Oct 10, 2026
On the versioned-defaults question: process versions landed in this morning's batch (#533). Settings saved without a process read as V1, while new photos and Reset get the latest process. A new tone model branches in
finish::base_tone(docs/process-versions.md). So a DNG tone fit could ship without changing DNGs that were already edited: add aProcess::V2whose arm uses the DNG's fitted curve, and keep V1's arm as it is, ignoring a curve that came from a DNG fit (for example via a flag onSourceInfo). The ARW and NEF look changes so far shipped withLOOK_VERSIONand render-cache bumps instead, so it's for @echelon to say which this one should use.Two coordination notes for the merged PR:
fit_partial_on. LR-PROF-CAMERACOLOR: fit the tone curve of low-contrast scenes (range limit 1.5 to 1.2) #699 adds a bright-area check for curves fitted to a narrow range (under 1.5×), and LR-PROF-CAMERACOLOR: fit a partial camera look for mostly-sky frames #784 adds a second attempt with bright, unclipped pairs and an extra parameter. A DNG tone fit built onfit_partial_onwould get both.LOOK_VERSIONto 3. Whichever lands later takes the next number, and I'm happy to rebase mine.radialmonster commentedon Oct 10, 2026
@AlexChambers thanks, two additions for the coordination list:
Process::V2isn't on main yet. LR-EDIT-LIGHT-HIGHLIGHTS: keep local contrast under Highlights and Shadows #645 (Highlights/Shadows keep local contrast) adds it, as echelon asked. I rebased it onto current main today. If the DNG tone fit should also leave existing edits alone, it can add its arm to the same V2, provided both land in the same release. Otherwise it takes a V3. Either way it should be stacked on LR-EDIT-LIGHT-HIGHLIGHTS: keep local contrast under Highlights and Shadows #645, so there's only one V2 definition.LOOK_VERSION: LR-PROF-CAMERACOLOR: median Canon camera tone for CR3s without an embedded JPEG (HDR-PQ shots) #758 (median Canon tone for CR3s without an embedded JPEG) also bumps it to 3. That makes four: LR-PROF-CAMERACOLOR: fit the tone curve of low-contrast scenes (range limit 1.5 to 1.2) #699, LR-PROF-CAMERACOLOR: refine partial looks with measured colour #732, LR-PROF-CAMERACOLOR: median Canon camera tone for CR3s without an embedded JPEG (HDR-PQ shots) #758 and @ingolfteetz's branch. As you say, whichever lands later takes the next number.ingolfteetz commentedon Oct 10, 2026
@radialmonster if you do not mind, do a rebase on your side, I have a bit of a time problem the next days. Anyway happy to contribute now and in the future.
radialmonster commentedon Oct 10, 2026
@ingolfteetz no problem, thanks! I'll rebase mine onto main with both of your guards (the
PreviewApplicationNameorigin check and the smallest covering preview), credit you in the commit, and post the 89-file numbers on the PR when it's up.radialmonster commentedon Oct 10, 2026
@ingolfteetz the rebase is up as #807, with your two guards credited in the commit. It now covers any camera DNG with a colour matrix and no
ProfileToneCurveor gain table map, and leaves phones out. On the raw.pixls.us DNGs with a camera JPEG, 62 of 73 eligible files are fitted, and median ΔE76 against the camera JPEG goes from 12.2 to 3.2 with none worse. The other files render byte-identically to main. @echelon it bumpsLOOK_VERSIONto 3 like the other three PRs, so whichever lands later takes the next number.LRC-DEV-PROCESS: the measured tone model is process V2, and V1 is frozen