Announcement

Collapse
No announcement yet.

Getting an exact RGB value

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    I only act like I know everything, Rogers.

  • #2
    [EDIT by Vlado] Image removed because of extreme gore...
    MDI Digital
    moonjam

    Comment


    • #3
      Whoops - sorry vlado!

      I was just implying that this was way over my head.
      MDI Digital
      moonjam

      Comment


      • #4
        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....
        ____________________________________

        "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

        Comment


        • #5
          Cool!! Sounds simple enough.

          lol percy.. leftys unite
          (hate math too)

          Comment


          • #6
            Very useful thanks Vlado.
            =:-/
            Laurent

            Comment


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

              Lele

              Comment


              • #8
                Originally posted by studioDIM
                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 !


                Best regards,
                nikki Candelero
                .:: FREE Your MINDs, LIVE Your IDEAS ::.

                Comment


                • #9
                  http://www.chaosgroup.com/forum/phpB...er=asc&start=0

                  Thanks so much, Vlado, for the idea.

                  Lele.

                  Comment


                  • #10
                    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?
                    Bobby Parker
                    www.bobby-parker.com
                    e-mail: info@bobby-parker.com
                    phone: 2188206812

                    My current hardware setup:
                    • Ryzen 9 5900x CPU
                    • 128gb Vengeance RGB Pro RAM
                    • NVIDIA GeForce RTX 4090
                    • ​Windows 11 Pro

                    Comment


                    • #11
                      (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

                      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

                      Comment


                      • #12
                        (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
                        Studio Max 2009 x64
                        X5000 Chipset | Dual Core Intel 5140 | 4G RAM | Nvidia FX3450 drv 6.14.10.9185

                        Comment


                        • #13
                          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?
                          Bobby Parker
                          www.bobby-parker.com
                          e-mail: info@bobby-parker.com
                          phone: 2188206812

                          My current hardware setup:
                          • Ryzen 9 5900x CPU
                          • 128gb Vengeance RGB Pro RAM
                          • NVIDIA GeForce RTX 4090
                          • ​Windows 11 Pro

                          Comment


                          • #14
                            im pretty sure it would be gamma 1.0

                            Comment


                            • #15
                              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,12
                              Color I get: rgb (224,233,233)

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

                              Comment

                              Working...
                              X