{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/rio-color/issues/6","repository_url":"https://api.github.com/repos/mapbox/rio-color","labels_url":"https://api.github.com/repos/mapbox/rio-color/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/rio-color/issues/6/comments","events_url":"https://api.github.com/repos/mapbox/rio-color/issues/6/events","html_url":"https://github.com/mapbox/rio-color/issues/6","id":134090041,"number":6,"title":"Saturation operator","user":{"login":"celoyd","id":148985,"avatar_url":"https://avatars.githubusercontent.com/u/148985?v=3","gravatar_id":"","url":"https://api.github.com/users/celoyd","html_url":"https://github.com/celoyd","followers_url":"https://api.github.com/users/celoyd/followers","following_url":"https://api.github.com/users/celoyd/following{/other_user}","gists_url":"https://api.github.com/users/celoyd/gists{/gist_id}","starred_url":"https://api.github.com/users/celoyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/celoyd/subscriptions","organizations_url":"https://api.github.com/users/celoyd/orgs","repos_url":"https://api.github.com/users/celoyd/repos","events_url":"https://api.github.com/users/celoyd/events{/privacy}","received_events_url":"https://api.github.com/users/celoyd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-16T20:35:27Z","updated_at":"2016-02-17T14:33:54Z","closed_at":null,"body":"One of the `convert` flags we want to replace is the second argument to `-modulate`, which adjusts saturation. _(Pulled out of #5.)_ Braindumping some options, in order of increasing hackiness:\r\n\r\n1. The conceptually straightest path here is to convert RGB to a radial colorspace that has a dedicated saturation channel, multiply that channel, and convert it back. Our default radial colorspace is LCH, because it combines [a nicely grounded definition](https://en.wikipedia.org/wiki/Lab_color_space) with a good approximation of perceptual uniformity. Unfortunately, the conversion is relatively complex and resource-hungry: `skimage`, for example, goes RGB &rarr; Lab &rarr; LCH and back.\r\n\r\n2. We could use HSV, which has a simpler definition.\\* The :-1: I see is setting a precedent of using HSV, which isn’t our best practice. I think it’s wiser to keep `rio color` in a “gold standard” role instead of a “workable approximation” role – for that, you might as well write your own functions. \\*Though _possibly_ not faster, given that it has a 6-part `case`, as opposed to the trig functions of the LCH route. I don’t have good intuition about numpy optimization.\r\n\r\n3. We could work out an equivalent (ish) saturation operator that works directly on RGB pixels. I see this as even more of a hack: by the time it was well defined, it’d be doing 80% of the work of converting to and from a radial colorspace anyway. On the :+1:, it would probably be very fast and do a fairly good job of matching any other saturation operator.\r\n\r\nHow do you see this, @perrygeo?"},"comment":{"url":"https://api.github.com/repos/mapbox/rio-color/issues/comments/185230330","html_url":"https://github.com/mapbox/rio-color/issues/6#issuecomment-185230330","issue_url":"https://api.github.com/repos/mapbox/rio-color/issues/6","id":185230330,"user":{"login":"perrygeo","id":1151287,"avatar_url":"https://avatars.githubusercontent.com/u/1151287?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygeo","html_url":"https://github.com/perrygeo","followers_url":"https://api.github.com/users/perrygeo/followers","following_url":"https://api.github.com/users/perrygeo/following{/other_user}","gists_url":"https://api.github.com/users/perrygeo/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygeo/subscriptions","organizations_url":"https://api.github.com/users/perrygeo/orgs","repos_url":"https://api.github.com/users/perrygeo/repos","events_url":"https://api.github.com/users/perrygeo/events{/privacy}","received_events_url":"https://api.github.com/users/perrygeo/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T14:33:54Z","updated_at":"2016-02-17T14:33:54Z","body":"Color noob question: in the LCH colorspace, adjusting C is roughly equivalent to saturation, correct?"}}