Getting an exact RGB value

I had to deal with this recently, so I thought it may be useful.

The problem:

We want to obtain an exact RGB value for some (small) surface in our image. Let’s say the RGB value is xr, xg, xb which range from 0 to 255.

The solution:

1) Render the scene in any way you want with any settings you want, but make sure you use Linear color mapping with 1.0 for both Bright and Dark multipliers and the “Clamp output” option is off, and you are using the V-Ray camera “Exposure” setting. It would also be handy if you render to the V-Ray VFB.

2) Measure the RGB value at the pixel you need to match. If the values are, let’s say (pr, pg, pb) again from 0 to 255, adjust the V-Ray camera “White balance” to be (pr*255/xr, pg*255/xg, pb*255/xb) and multiply the camera ISO setting by (xr+xg+xb)/(pr+pg+pb).

Note that this works only for Linear color mapping. In principle it can be done for any color mapping, but the numbers are hard to find by hand.

Best regards,
Vlado

[EDIT by Vlado] Image removed because of extreme gore…

Whoops - sorry vlado!

I was just implying that this was way over my head.

I hate math with a passion (im left handed after all LOL) But if I squint and take a second, it seems pretty straightforward to me. You just have to apply yourself… :lol:

Cool!! Sounds simple enough.

lol percy.. leftys unite :wink:
(hate math too)

Very useful thanks Vlado. 8)

nice and clever.
I have to look into obtaining the perfect match through white balance …
Nice and clever, cheers.

Lele

I know you can do it ! GO GO GO !
:wink: :wink:

Best regards,
nikki Candelero

http://www.chaosgroup.com/forum/phpBB2/viewtopic.php?t=18357&postdays=0&postorder=asc&start=0

Thanks so much, Vlado, for the idea.

Lele.

RGB

A little help with the math please. I have a white box in my scene and when I render I get 255,255,187. I am using vraysun/sky with an ISO of 100. I am using LWF with gamma 2.2 in both vray color mapping and MAX. What would the equation look like?

(255*255/255, 255*255/255, 187*255/255) work that out and set it as your whitebalance
and multiply your camera iso by (255+255+255)/(255+255+187)

So basically put 255/255/187 in your whitebalance and times your ISO by 1.0975609756097560975609756097561 you can round it down if you want :slight_smile:

Thats it I believe.

Also read vlados post again. Says it only works with Linear color mapping. As using other methods makes it pretty hard to find the right numbers.

See how you go :slight_smile:

(255*255/255, 255*255/255, 187*255/255) work that out and set it as your whitebalance
and multiply your camera iso by (255+255+255)/(255+255+187)

So basically put 255/255/187 in your whitebalance and times your ISO by 1.0975609756097560975609756097561 you can round it down if you want Smile

Thats it I believe.

Also read vlados post again. Says it only works with Linear color mapping. As using other methods makes it pretty hard to find the right numbers.

See how you go Smile

Dear glorybound,

As an additional side note …

Just in case you aren’t familar with the algebra expression from vlado.
Well sometimes your white isn’t 255 full value. Mine is often set to about
(220R,220G,220B) where “x” represents the number of RGB you are trying to
match and “p” represents the color your color picker records off the
pre-corrected rendering on the vfb.

Then it would look like this,

(255*255/220, 255*255/220, 187*255/220) for the first part …

best regards,
Victor NSY

Matching RBG

This has never worked for me. I get close, but the numbers don’t match. I should try it at home and see if it is my office setup. One question… should this calc be done with gamma at 1 or 2.2?

im pretty sure it would be gamma 1.0

When I use this method, I get numbers over 255.
is something wrong in formula? or what am I doing wrong?

Color I want see is medium gray: rgb (128,128,128)
Color I get: rgb (224,233,233)

so
r: 224x255/128 = 446.25
g: 233x255/128 = 464.179

As i understand it, the formula works to adjust the hue not the exposure, so in your example you’d need to adjust the exposure to be closer in range then use the formula along with the color balance to remove the sun/sky tint. Not sure if the iso formula would work to get you in range first, and I’m too lazy to try it right now. heh :wink:

or maybe 255 is not up pn the fraction but down ?
:slight_smile:

Ask

s What are representatives?
p What are representatives?

PR

Proposed
Real

Or that is how I saw it.

“Let x equal the windmill”

Excellent.