Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XYZ to RGB debug #24

Open
ChenJash opened this issue Aug 10, 2023 · 1 comment
Open

XYZ to RGB debug #24

ChenJash opened this issue Aug 10, 2023 · 1 comment

Comments

@ChenJash
Copy link

Thank you for your code. I use C++to process colors temporarily, and these codes have provided me with some convenience.

An error was found in the XYZ_to_RGB.hpp

There is an error in the calculation order of converting linear rgb to srgb in line 19. The correct order is:

std:: pow (linear srgb color (i), 1.0/2.4) * 1.055-0.055

Perhaps you can verify and fix this issue.

@yuki-koyama
Copy link
Owner

Thanks for pointing this out! It seems that my equation was wrong. I am not sure why it passed the test (

if ((delta = (rgb_color - colorutil::convert_XYZ_to_RGB(xyz_color)).norm()) > 1e-5)
), but anyway the equation should definitely be fixed.

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

No branches or pull requests

2 participants