POV-Ray : Newsgroups : povray.binaries.scene-files : Reinterpreting colors.inc colors as sRGB : Re: Reinterpreting colors.inc colors as sRGB Server Time
26 Apr 2024 18:45:02 EDT (-0400)
  Re: Reinterpreting colors.inc colors as sRGB  
From: Kenneth
Date: 9 May 2016 07:10:00
Message: <web.57306f5d4aeaea2333c457550@news.povray.org>
I second Thomas's comment. Thanks, this looks very useful.

I'm curious about something though. In 3.7.0's "colors.inc" file, there are some
macros for converting between RGB, HSL and HSV, and vice-versa. I've never used
those, but I thought I would take a look at them anyway. Most of the macros seem
OK to use, even in an srgbt world. But one macro looks suspicious ;-) ...

// Converts a color in RGB color space to a color in HSL color space.
// Input:  < Red, Green, Blue, Filter, Transmit >
// Output: < Hue, Saturation, Lightness, Filter, Transmit >
#macro CRGB2HSL(Color)
......
#end

Would the equations there still be correct when giving the macro an srgb color?
For example, let's say I'm rendering a scene with srgb <.3,.5,.7> as an
*on-screen* color (a 'gamma-bent' color, although I realize that the rgb colors
themselves are actually 'linear' colors.) Feeding those linear rgb colors to the
macro would result (by my thinking) in an HSL color that wouldn't quite match
what I was seeing on-screen. (Assume that I'm running v3.7xx with the proper
assumed_gamma 1.0).

At least, that's how it seems to me, although I could be wrong.

Does that macro need updating for your "colors_srgb.inc" file?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.