Skip to content

gainmapmath: write green channel in RGB888 output - #443

Merged
DichenZhang1 merged 1 commit into
google:mainfrom
gregbenz:codex/fix-rgb888-green
Aug 14, 2026
Merged

gainmapmath: write green channel in RGB888 output#443
DichenZhang1 merged 1 commit into
google:mainfrom
gregbenz:codex/fix-rgb888-green

Conversation

@gregbenz

Copy link
Copy Markdown
Contributor

What changed

  • Write pixel.g to the green byte in putRgb888Pixel().
  • Add a regression test using distinct red, green, and blue values.

Why

putRgb888Pixel() currently writes pixel.r to both the red and green bytes. Any
RGB888 output where red and green differ is therefore color-corrupted. Writing the
actual green component preserves the requested RGB pixel values.

Testing

  • Added GainMapMathTest.PutRgb888PixelWritesGreenChannel; it fails on current main
    and passes with this change.
  • Full non-HEIF unit suite: 1,291 tests run; 1,067 passed and 224 existing parameter
    combinations skipped.

@google-cla

google-cla Bot commented Aug 13, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@DichenZhang1 DichenZhang1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for finding and fixing this bug!

@gregbenz

Copy link
Copy Markdown
Contributor Author

@DichenZhang1 thank you and the team for all these great enhancements and ongoing support of this critical library for HDR!

@DichenZhang1
DichenZhang1 merged commit 924967a into google:main Aug 14, 2026
26 of 27 checks passed
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.

2 participants