Skip to content

Conversation

@xkns
Copy link
Contributor

@xkns xkns commented Nov 17, 2022

Summary
The Oklab reference implementation (#1477) can under some circumstances output RGB colors (components of type double) with slightly negative values. (I'm not sure if this is due to imprecise operations or just the nature of the internal gamut mapping.)

When converting those double components back to bytes a rollover could occur leaving the affected component with a value of 255 instead of the intended 0.

This PR fixes that issue by clamping the components just before type conversion happens.

And sorry for not catching this with the initial PR.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@hyperion-project
Copy link

Hello @xkns 👋

I'm the Hyperion Project Bot and I want to thank you for
contributing to Hyperion with your pull requests!

To help you and other users test your pull requests faster,
I'll create a link for you to your workflow artifacts.

🔗 https://github.com/hyperion-project/hyperion.ng/actions/runs/3489621707

Of course, if you make changes to your PR, I will create a new link.

Best regards,
Hyperion Project

@Lord-Grey Lord-Grey merged commit 7a31e2b into hyperion-project:master Nov 24, 2022
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