{"action":"created","issue":{"url":"https://api.github.com/repos/gtaylor/python-colormath/issues/56","labels_url":"https://api.github.com/repos/gtaylor/python-colormath/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/gtaylor/python-colormath/issues/56/comments","events_url":"https://api.github.com/repos/gtaylor/python-colormath/issues/56/events","html_url":"https://github.com/gtaylor/python-colormath/issues/56","id":98166624,"number":56,"title":"poor conversion between lchab and srgb","user":{"login":"matkoniecz","id":899988,"avatar_url":"https://avatars.githubusercontent.com/u/899988?v=3","gravatar_id":"","url":"https://api.github.com/users/matkoniecz","html_url":"https://github.com/matkoniecz","followers_url":"https://api.github.com/users/matkoniecz/followers","following_url":"https://api.github.com/users/matkoniecz/following{/other_user}","gists_url":"https://api.github.com/users/matkoniecz/gists{/gist_id}","starred_url":"https://api.github.com/users/matkoniecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkoniecz/subscriptions","organizations_url":"https://api.github.com/users/matkoniecz/orgs","repos_url":"https://api.github.com/users/matkoniecz/repos","events_url":"https://api.github.com/users/matkoniecz/events{/privacy}","received_events_url":"https://api.github.com/users/matkoniecz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-30T13:15:45Z","updated_at":"2015-08-02T09:09:14Z","closed_at":null,"body":"lchab may be converted to value that is not optimal. For example LCHabColor(89, 7, 75) is converted to rgb(231, 222, 211) but for example rgb(233,222,211) would be a better target.\r\n\r\nrgb(231, 222, 211) converted back to lchab is (88.9, 6.8, 79.8)\r\nrgb(233, 222, 211) converted back to lchab is (88.7, 6.9, 74.2) what is closer to (89, 7, 75)\r\n\r\nIt is also possible that rgb to lchab conversion is broken. According to http://www.brucelindbloom.com/index.html?Math.html lchab -> srgb conversion works and srgb -> lchab is broken.\r\n\r\n\r\nCuriously, http://www.colorhexa.com/ has different results for lchab -> srgb conversion but the same for srgb -> lchab.\r\n\r\nAccording to brucelindbloom lchab(89, 7, 75) = rgb(231.3, 222.1, 210.7)\r\nAccording to colormath it is (231, 222, 211)\r\nAccording to colorhexa.com it is (233, 222, 211).\r\n\r\nAccording to brucelindbloom rgb(231, 222, 211) = lchab(89.0, 6.8, 74.7)\r\nAccording to colormath it is lchab(88.6, 6.7, 79.5)\r\nAccording to colorhexa.com it is lchab(88.9, 6.6, 79.5)\r\n\r\nEither there is something broken somewhere or I am missing parameter that is set differently in these tools. I see no way to set reference white and adaptation in python-colormath and colorhexa, so it seems that d50 and Bradford may be assumed to be defaults. sRGB nearly certainly may be assumed to be default in colorhexa.\r\n\r\n```\r\nfrom colormath.color_conversions import convert_color\r\nfrom colormath.color_objects import LabColor, LCHabColor, SpectralColor, sRGBColor, \\\r\nXYZColor, LCHuvColor, IPTColor\r\n\r\n\r\nlch = LCHabColor(89, 7, 75)\r\nrgb = convert_color(lch, sRGBColor)\r\nprint(rgb.get_upscaled_value_tuple())\r\nlch = convert_color(rgb, LCHabColor)\r\nprint(lch.get_value_tuple())\r\n\r\nother_rgb = sRGBColor(233.0/256,222.0/256,211.0/256)\r\nlch = convert_color(other_rgb, LCHabColor)\r\nprint(lch.get_value_tuple())\r\n\r\nother_rgb = sRGBColor(231.0/256,222.0/256,211.0/256)\r\nlch = convert_color(other_rgb, LCHabColor)\r\nprint(lch.get_value_tuple())\r\n```"},"comment":{"url":"https://api.github.com/repos/gtaylor/python-colormath/issues/comments/127000839","html_url":"https://github.com/gtaylor/python-colormath/issues/56#issuecomment-127000839","issue_url":"https://api.github.com/repos/gtaylor/python-colormath/issues/56","id":127000839,"user":{"login":"matkoniecz","id":899988,"avatar_url":"https://avatars.githubusercontent.com/u/899988?v=3","gravatar_id":"","url":"https://api.github.com/users/matkoniecz","html_url":"https://github.com/matkoniecz","followers_url":"https://api.github.com/users/matkoniecz/followers","following_url":"https://api.github.com/users/matkoniecz/following{/other_user}","gists_url":"https://api.github.com/users/matkoniecz/gists{/gist_id}","starred_url":"https://api.github.com/users/matkoniecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkoniecz/subscriptions","organizations_url":"https://api.github.com/users/matkoniecz/orgs","repos_url":"https://api.github.com/users/matkoniecz/repos","events_url":"https://api.github.com/users/matkoniecz/events{/privacy}","received_events_url":"https://api.github.com/users/matkoniecz/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T09:09:14Z","updated_at":"2015-08-02T09:09:14Z","body":"@KelSolaar How can I run this code? Adding ```import numpy as np``` is not enough, it still crashes with ```AttributeError: 'module' object has no attribute 'ILLUMINANTS'``` on\r\n\r\n>    D50 = colour.ILLUMINANTS['cie_2_1931']['D50']\r\n"}}