Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've seen CIELab used to do color transformations, and it has a problem. This color space looks like it will suffer from the same problem.

If you try to shift hues, keeping a constant luminance causes a problem. You can't transform a bright blue to a bright yellow, because the luminance of blue is considered much lower than yellow. The best you'll get is a very dark brown.



What is the goal of your hue shift?

If your goal is to otherwise preserve color relationships, then you should use a perceptually relevant color space.

But maybe you have some different goal...?


Sometimes the goal is just to change the color of an object while retaining the shadows, highlights, and textures. Suppose you had a picture of a blue car and wanted to know what it would look like in yellow.


Personally I use this tool I built as a Photoshop action over a decade ago, https://www.hcs.harvard.edu/~jrus/colortheory/jl.html (see the animation at the bottom showing almost precisely what you are asking about) Initial discussion: https://www.ledet.com/margulis/2010HTM/ACT08-Jacobs_Ladder.h...

An HSV hue shift (or whatever similar thing you are thinking of) yields horrible results in this use case.


That example looks like it's working directly with RGB, which I expect to be correct. I've also seen it work well in HLS. But I worked on a tool where we were told to change from HLS to CIELab because it would be better, and it turned out to be much worse in practice.


I almost always use CIELAB as a working color space for photographic work (my action linked previously converts to 16 bit/channel CIELAB space as its first step, though you could use a similar type of tool in RGB mode if you wanted to). But I have a pretty good idea of the final RGB (or other) gamut I am aiming for.

Photoshop is definitely designed RGB-first, and some of the tools get a bit clunky in CIELAB mode. It is still an improvement for most of what I want to do.

I have many ideas for better image color manipulation tools.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: