Skip to content

fix: gate TIFF sRGB decode behind Linear RAW toggle#590

Merged
marcinz606 merged 1 commit into
mainfrom
fix/tiff-linear-raw-srgb-tag
Jul 21, 2026
Merged

fix: gate TIFF sRGB decode behind Linear RAW toggle#590
marcinz606 merged 1 commit into
mainfrom
fix/tiff-linear-raw-srgb-tag

Conversation

@marcinz606

@marcinz606 marcinz606 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • TIFF loader unconditionally degamma'd sRGB-tagged (and untagged 8-bit) TIFFs to scene-linear, which lifts shadows when the tag doesn't match the actual encoding (e.g. output from a stitcher that always tags sRGB regardless of source).
  • Linear RAW toggle now controls this: on = literal linear decode, ICC/EXIF colour tag ignored; off = existing colour-managed decode (unchanged default for untouched call sites).

closes #589

Test plan

  • uv run pytest — 2385 passed, 1 skipped
  • uv run ruff check . — clean
  • uv run ty check — clean on touched files
  • New tests: test_linear_raw_ignores_srgb_icc_tag, test_linear_raw_ignores_untagged_uint8_srgb_assumption

A TIFF tagged (or assumed) sRGB got degamma'd to scene-linear
unconditionally, lifting shadows when the tag lied about the actual
encoding (e.g. stitcher output). Linear RAW now controls this per the
same neutral-decode semantics it already has for camera RAW.
@github-actions

Copy link
Copy Markdown

Preview load metrics (github-linux-x64)

format cold load throughput
CR2 0.831 s 27.00 MPx/s
NEF 0.678 s 36.28 MPx/s
ARW 0.242 s 83.25 MPx/s
RAF 0.599 s 27.14 MPx/s
DNG 0.696 s 34.37 MPx/s

fixtures: rawsamples.ch · sha: 1ce383c · full JSON

@marcinz606
marcinz606 merged commit 2d8e55e into main Jul 21, 2026
2 checks passed
@marcinz606
marcinz606 deleted the fix/tiff-linear-raw-srgb-tag branch July 21, 2026 17:00
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.

sRGB tagged TIFFs are treated differently from other ICC tagged TIFFs

1 participant