-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Adding HSV, Lab, or other color modes #624
Comments
So, a couple of things to look at:
HSV would probably be a useful image mode, especially since I think that there are storage formats that use it. Conversions with extra parameters might be better off going through libcms, or, perhaps we could extend convert. However, we'd need to be careful on that one, since apis are forever. |
Thanks for the input, @wiredfool! HSV is, IME, the easiest thing to implement, and since it doesn't require any other parameters other than the RGB values, I'll look at adding a mode for it as a starting place. Thanks for the pointer to ImageCMS—I'll explore that further as well. I'll also examine the existing Lab mode and see if there are ways it can be enhanced or expanded for additional image analysis work. I still welcome any and all additional feedback from the community. |
HSV implemented in #816. |
Dang, I was going to work on this at our upcoming company-wide hack session. Thanks for jumping on it, @wiredfool. |
Sorry I preempted your hack session. I'd actually forgotten about this issue. |
No big, just need to find another way to contribute! |
Sometimes (well, actually, many times in image analysis) it's useful to work with image data in forms other than R,G,B 3-tuples. I've come up with some code to convert RGB to HSV (hue, saturation, and value or brightness), but I also can see where other conversions might be useful. The math is well known, but some conversions require either additional information (e.g. a reference white point), or some well-defined defaults. At first thought, it seemed as though this was best implemented as an image mode, but that might not really be the right semantics, since these other color representations don't really map to an image file format.
Perhaps this might be better implemented as utility functions? Properties on the
Image
class? I'd like to get some input from others before simply coding up a solution and submitting a pull request.Fair warning: I know enough about color theory to be dangerous; not 100% confident I know enough on my own to do all the work myself. Therefore, I especially welcome input from anyone with experience in color spaces, perceptual color models, etc.
The text was updated successfully, but these errors were encountered: