Add Panasonic RW2 embedded lens distortion correction - #21656
Open
andriiryzhkov wants to merge 1 commit into
Open
Add Panasonic RW2 embedded lens distortion correction#21656andriiryzhkov wants to merge 1 commit into
andriiryzhkov wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Panasonic bodies embed the distortion correction their built-in and Lumix-branded lenses need – Lightroom apply it silently. darktable ignores it, so users of the LX100 series, TZ superzooms, and various Lumix S primes fall back to lensfun, which has no profile for many of these lenses (the built-in zooms in particular can't get one since they're camera-specific).
Parses tag
Exif.PanasonicRaw.0x0119(32-byte int16 blob) and plugs into the existing embedded-metadata path alongside Sony / Fuji / Olympus / DNG. Polynomial per Rigo's reverse-engineering (trou/panasonic-rw2):Ru = Rd + scale·(a·Rd³ + b·Rd⁵ + c·Rd⁷). Inverted with two fixed-point iterations in_init_coeffs_md_v2to produce the src/dst radius spline the pipeline already uses. Validated on DC-L10 + Leica DC VARIO (mild barrel), DC-S5M2 + Samyang 35-150 (moderate barrel), DC-S5M2X + Sigma 100-400 (strong pincushion).Roundtrip preserved via the whitelist-plus-numeric-copy pattern from #21449 – the tag is copied to
Exif.Image.0xf119(TIFF private range) on export so re-imported TIFF/DNG still offer the "embedded metadata" option.Not addressed: chromatic aberration (tag 0x011b, format still not publicly reverse-engineered – RawTherapee shipped their attempt disabled), and vignetting (Panasonic bakes it into the raw pixels when
ShadingCompensationis on, so there are no coefficients to read).