Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

conversion between different RGB spaces doesn't work #63

Open
jan-warchol opened this issue Jun 29, 2016 · 2 comments
Open

conversion between different RGB spaces doesn't work #63

jan-warchol opened this issue Jun 29, 2016 · 2 comments

Comments

@jan-warchol
Copy link
Contributor

When I try to convert from one RGB space to another RGB space, I receive the result in the original space, not in the target space I specified:

from colormath.color_objects import sRGBColor, AdobeRGBColor
from colormath.color_conversions import convert_color

convert_color(sRGBColor(.5, .5, .5), AdobeRGBColor)
# result: sRGBColor(rgb_r=0.5,rgb_g=0.5,rgb_b=0.5)

If I go through a non-RGB space it works:

convert_color(convert_color(sRGBColor(.5, .5, .5), LabColor), AdobeRGBColor)
# result: AdobeRGBColor(rgb_r=0.49622736126049893,rgb_g=0.49622594102136347,rgb_b=0.49622822419096463)
j-warchol pushed a commit to jan-warchol/selenized that referenced this issue Jun 29, 2016
RGB->RGB conversion in colormath is broken, the result is not in the
target space (gtaylor/python-colormath#63).
Going through LAB yields correct result.
@gtaylor
Copy link
Owner

gtaylor commented Jul 1, 2016

That's pretty weird. I honestly probably won't get around to checking this out anytime soon, but I'd certainly accept a PR with a fix. Bonus points for a matching test case.

@jan-warchol
Copy link
Contributor Author

I looked at the code before submitting this issue, but from what I see the logic is non-trivial (using some transformation graphs) and I didn't see anything obvious. I will look at this again if I find enough time.

j-warchol pushed a commit to jw-git-examples/git-example-sele-utils that referenced this issue Jun 28, 2017
RGB->RGB conversion in colormath is broken, the result is not in the
target space (gtaylor/python-colormath#63).
Going through LAB yields correct result.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants