1
$\begingroup$

In short:

  1. Generate Mesh and choose color in color picker for the whole mesh (The mesh in the example below is a simple cube)
  2. Read color (three float values) via Python and send them (with mesh details and uv-map ect) to a C++-Application
  3. C++-Application creates a image which should be used as a texture

Problem:

The color, which is shown in the color picker isn't the same as the color of the texture.

I use the three float values, calculate the values between 0 and 255 and set the rgb-channels. Then the image is saved.

Some Screenshots:

color picker with rgb

color picker with rgb

RGB-Values via GIMP:

  • R = 184
  • G = 119
  • B = 255

RGB-Values calculated and rounded: (255 * value)

  • R = 0.479 * 255 = 122
  • G = 0.184 * 255 = 47
  • B = 1.0 * 255 = 255

They aren't the same?

Generated Texture

enter image description here

RGB-Values via GIMP:

  • R = 122
  • G = 47
  • B = 255

Renderen with Blender Cycles

And now a Screenshot from the Mesh + Texture rendered via Cycles (with Ambient Occlusion). I removed the default lamp because I wan't to get a clean output.

enter image description here

RGB-Values of the color picker via GIMP (same as above):

  • R = 184
  • G = 119
  • B = 255

RGB-Values of the cube via GIMP:

  • R = 125
  • G = 48
  • B = 255

What is the problem?

PS: I didn't know which tags I should use for this question. So please remove or add tags if you think that would be better. Thanks!

$\endgroup$
  • 2
    $\begingroup$ It might be because you're not using the color in the same color space Blender is using, or because Blender gamma corrects the colors. $\endgroup$ – someonewithpc Jul 13 '15 at 17:09
  • $\begingroup$ So I need to undo the gamma correction, create the texture with the new rgb-values and blender is adding gamma correction when the image is loaded? $\endgroup$ – Hamburml Jul 13 '15 at 17:18
  • 1
    $\begingroup$ I think so, but I'm not sure $\endgroup$ – someonewithpc Jul 13 '15 at 17:19
1
$\begingroup$

The values differ because the rgb-values of the color picker aren't gamma corrected.

If I correct them like answered here https://stackoverflow.com/a/17910665/3069477 the colors are matching. I still get different RGB-Values but the difference is really small (rounding error).

Resulting Screenshot:

enter image description here

Thanks @someonewithpc!

$\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.