2
$\begingroup$

I am rendering a scene with the intent to label objects using a "solid" color.

For this, objects have an emissive shader where I set the RGB colors by script.

In the render view, when I click on the pixels, the color codes are correct. Once I save the render and open it in an image processing program, the color codes change. I tried different image formats and with the exception of OpenEXR this does occur with slightly different outcomes in all image formats. So I guess it probably has something to do with compression or color space conversion? I expect it should still be possible to obtain a predictable color using PNG or JPEG.

What kind of settings am I missing?

$\endgroup$
  • $\begingroup$ related: blender.stackexchange.com/questions/28284/… FOR ACCURATE COLOR RENDERING READ THIS POST: blender.stackexchange.com/questions/31068/… $\endgroup$ – cegaton Mar 16 '16 at 14:50
  • $\begingroup$ Thank you, but I am not sure this is what I really need. I am not particularly interested in the values that I see on my display. All I want is that when I set the color to e.g. (220, 0, 0) and an emissive shader that the pixel in the image is stored as (220, 0, 0). $\endgroup$ – user1033657 Mar 16 '16 at 16:13
  • $\begingroup$ did you try to modify settings in the color management (scene data) ? $\endgroup$ – Yvain Mar 16 '16 at 20:20
  • $\begingroup$ Yes I did, and though it did change things, I still did not manage to get it to match exactly. $\endgroup$ – user1033657 Mar 17 '16 at 8:54
2
$\begingroup$

First, "colour codes", aka hex values, have no absolute meaning. The values, whether stored in hexadecimal, integer, or float, represent an encoded value with respect to a given colourspace. Frequently, with display referred imagery downloaded from the web, this is sRGB. In a plethora of many other contexts however, it is not sRGB, hence the values have no absolute meaning.

Second, it sounds like you are having issues with a understanding the conversion of a display referred image to a display linear version, via an inversion of the encoded values transfer curve. There are a few posts here regarding that. The TL;DR is that the RGB values will represent linearized (display linear in cases where you are using an encoded PNG or JPEG, for example) values.

Third, bear in mind that while some values are labeled "Diffuse Colour" in shaders for example, they represent nothing of the sort, but rather a float ratio from zero to one of reflectance with angle math, also known as an albedo. Here, "Diffuse Colour" is a misleading term, and may have imagers conflating an albedo for an intensity triplet.

Finally, bear in mind that file formats are not created equally, nor are their implementations consistent across applications and libraries. A file format can store a variety of different imaging alpha channel encodes, colour spaces, and encoding formats.

The solution would be to take your encoded colour values and linearize them. If you are using an emission shader, bear in mind that in scene referred terms, there is no ceiling value and the dynamic range is from zero to infinity.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.