Skip to content

Implement DNG black level delta V correction (Fix for Magenta Coloring of older DNG files) - #1862

Open
borgfriend wants to merge 3 commits into
CyberTimon:mainfrom
CodeAndChaos:main
Open

borgfriend wants to merge 3 commits into
CyberTimon:mainfrom
CodeAndChaos:main

Conversation

@borgfriend

Copy link
Copy Markdown

Added support for DNG black level delta V processing in raw image data.

Description

Instructed Opus to do an analysis why my oder DNG files were colored magenta.

The stronger suspect is the pinned rawler DNG decoder: its get_blacklevels implementation reads BlackLevel but appears not to apply BlackLevelDeltaV. RapidRAW then uses the resulting black level in its rescaling at raw_processing.rs:169. Leaving roughly 256 levels of sensor black uncorrected can become a magenta cast after white-balance gains.

Instructed it to fix the issue.

Note: It does render the dng correctly but existing preview images are not updated.

This should fix the issues:
#1785
#1542

Type of Change

  • [ x ] Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

It added a BlackLevelDeltaV function that only effects the older files.

Screenshots/Videos

Testing

  • These changes were tested locally by a human and confirmed to work.
  • I haven't added any automated tests to the code because the codebase currently lacks a test suite.

No clue about the tests Opus added them.

Test Configuration:

  • OS: macOS Golden Gate
  • Hardware: M4

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

AI Disclaimer:

Please state the involvement of AI in this PR:

  • This PR is created by an AI agent
  • This PR is mostly AI-generated but edited/merged together by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

Added support for DNG black level delta V processing in raw image data.
@borgfriend
borgfriend requested a review from CyberTimon as a code owner October 7, 2026 06:59
@CyberTimon

Copy link
Copy Markdown
Owner

Please remove the rust tests :)

Comment thread src-tauri/src/raw_processing.rs Outdated
1.0
}

#[cfg(test)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it added some tests here.

Copilot AI and others added 2 commits October 10, 2026 21:59
Co-authored-by: borgfriend <3630448+borgfriend@users.noreply.github.com>
Remove debug-only tests from raw processing module
@CyberTimon

Copy link
Copy Markdown
Owner

What do you think regarding the comment here?

#1785 (comment)

@borgfriend

Copy link
Copy Markdown
Author

Updated to 1.6.5 - problem still persists

Screenshot 2026-10-11 at 10 55 44 PM

Attached a dng file where you can see the problem
_MG_4405.dng.zip

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.

4 participants