Announcement

Collapse
No announcement yet.

More gamma stuff and linear workflows

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

  • More gamma stuff and linear workflows

    Hello,

    Since there seem to be lots of confusion about the whole linear workflow and gamma settings things, here is a more complete description.

    The source of the problem is that computer displays (CRT and recently LCD monitors) do not display colors in a linear fashion. That means that if you input a color like medium grey (RGB 128, 128, 12, when displayed on the screen it will *not* be twice as dark as pure white (RGB 255, 255, 255).

    The result is that the renderings that you see on your monitor do not correspond to the actual colors in your images. To compensate for this effect, the images must be color-corrected so that you see the actual colors.

    Since each monitor alters colors differently, there must be a way to calibrate different monitors to a common standard so that you can be sure that when you view your images on another monitor, they will look the same. This standard is known as 2.2 Gamma or sRGB color space. It was chosen because CRT monitors on average apply a 2.2-gamma transformation on the input colors. Therefore, correcting for 2.2 gamma requires only a little change in the displayed colors to fit them into the 2.2 curve.

    Note that for LCD monitors, things are somewhat different. The LCD output is a lot closer to linear. That means that calibrating an LCD monitor for 2.2 gamma output requires very large modification to the displayed colors. When combined with the fact that some LCD monitors still have less than 24-bit color resolution, it means that lots of color resolution is lost during this transformation. Therefore, it is often better to calibrate an LCD monitor to display linear colors, instead of trying to fit it into the 2.2 gamma framework.

    There are three main workflows that you can follow to work properly with digital images. Those are outlined below.

    I. Working in gamma space /w gamma display

    For this method, your monitor is calibrated to 2.2 gamma space, and your images have the corresponding inverse gamma corection baked into them.

    Your images don't need correction when viewed directly on the monitor, since they already have the correction baked into them. However, when you use images for other purposes (e.g. as textures, or when printing), you need to remove the correction. Also, when creating images, you need to bake the correction into them before saving the images to disk.

    For this method, you need to make sure that all your images have color correction applied. If this is not the case, and those images have been created with method II or III, you will need to correct them.

    Note also that this method is not suitable for compositing purposes. In order to get correct results, compositing must take place in linear space - e.g. 50% gray plus 50% grey must equal pure white. This is not the case if the 50% grey have been already gamma-corrected.

    In the old days of slow machines, CRT monitors and 8-bit image file formats, this was the preferred workflow, as it ensured that colors are stored with maximum precision and the most frequent operation on images - displaying them - is fast. With the advent of faster computers, LCD displays and 16-bit/floating point image formats, the situation is now different. All in all, this workflow is now obsolete and is not recommended.

    The only situation where you would still use this workflow, is when creating content that you know will be displayed on a CRT device - e.g. animation that will be played on a television screen. Even in this case, it is better to use one of the other workflows internally, and only bake the gamma transformation into the final result.

    II. Working in linear space /w gamma display

    For this method, your monitor is calibrated to 2.2 gamma space, but your images are stored in linear space. The corresponding inverse gamma correction is applied on the fly when viewing the images.

    You need to make sure that your applications can display the images with the inverse 2.2 gamma transformation, while keeping the actual image in linear space.

    Also, you need to make sure that all images you acquire from other sources (textures etc) are also in linear space. If this is not the case, and those images have been created with method I, you will need to first un-correct them. There is no need to correct or un-correct images that you make yourself, since these are already in linear space. There is also no need to correct or un-correct images created with method III, as they are also stored in linear space.

    If you are working with a CRT monitor, this is the preferred workflow. Calibrating a CRT monitor to 2.2 gamma requires only slight modification of its output. Further on, 16-bit and floating point image format ensure that the color display correction does not lose color precision.

    To use 3dsmax/V-Ray with this workflow:
    (*) Calibrate your monitor for 2.2 gamma output.
    (*) In the 3dsmax Customize/Preferences/Gamma dialog:
    - enable gamma correction;
    - set the gamma to 2.2;
    - check the Affect Color Selectors and Affect Material Editor options.
    - Leave input and output bitmap gamma to 1.0;
    (*) If a bitmap texture is created with method I and has gamma baked into it, you need to specify this gamma when loading the bitmap in 3dsmax, so that the correction can be removed.
    (*) Do not apply gamma correction to your rendered result.

    The only situation where you would break this and you can apply gamma correction to a rendering is if you know that it will be displayed on a CRT device that has no color correction - e.g. a television screen. Even in this case, it is recommended that you only apply the correction as a post-process and not bake it in the rendering itself.

    III. Working in linear space /w linear display

    For this method, your monitor is calibrated for linear output, and your images are stored in linear space. No color correction is necessary when working with the images, with the exception when you are using images (e.g. textures) created with method I. In that case, you will need to un-correct them before usage.

    If you are using an LCD monitor, this may be the preferred workflow. In that case, no color transformations are necessary, except if you use images produced by method I.

    Note that it may be tricky to use this method, as monitor calibrating software is usually designed to calibrate for 2.2 gamma. However, we need to calibrate for linear output (1.0 gamma).

    To use this method with 3dsmax and V-Ray:
    (*) Calibrate your monitor for linear output;
    (*) Disable gamma correction in 3dsmax;
    (*) Make sure all your textures are not gamma corrected. If a texture has some gamma correction baked into it, that needs to be removed first.
    (*) Do not apply gamma correction to your rendered result.

    The only situation where you would break this and you can apply gamma correction to a rendering is if you know that it will be displayed on a CRT device that has no color correction - e.g. a television screen. Even in this case, it is recommended that you only apply the correction as a post-process and not bake it in the rendering itself.

    -----------

    All in all, it doesn't matter which method you choose - but when you choose one, you need to stick to it.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

  • #2
    Great info. I know that when I look at images at one of my co-workers
    desk, the images look washed out and over bright. He is using an LCD.
    I think my monitor at home is pretty well callibrated, because when I
    view images from other locations on CRT's they seem to match good.
    Thanks for the info,
    Regards,
    Mike
    http://mikebracken.cgsociety.org/gallery/

    Comment


    • #3
      The issue I have as someone that teach this stuff... is that only around 30% of the users are aware of this, and of the 30% that are 95% of them use Method 1 to deal with it. As it is clearly stated in Vlados post. That is not the good way to go. Trying to convince people to use viewing LUTs is very hard.

      Comment


      • #4
        I think one of the issues with the second technique is that many of use still use 8 bit images. I only recently started playing with floating point images and only after watching the linear conversation unfold.

        Comment


        • #5
          Hi , i work with viz2007 and in the preferences »»gamma»» the "Affect color Selectors" and Affect Material Editor " is missing , what can we do ??
          regards
          Paulo Silva

          Comment


          • #6
            chris I agree. Especially hardcore old timers, who used to have 3 point light setup are blind to this.
            Dmitry Vinnik
            Silhouette Images Inc.
            ShowReel:
            https://www.youtube.com/watch?v=qxSJlvSwAhA
            https://www.linkedin.com/in/dmitry-v...-identity-name

            Comment


            • #7
              Originally posted by Morbid Angel
              chris I agree. Especially hardcore old timers, who used to have 3 point light setup are blind to this.
              I think that real world lightimg has forced people do deal with it, but to be honest, some of the old timers I know are well aware of this, especially if they deal with film. When rendering for film they had to use a 10bit log format such as Cineon, and it made viewing lute even more challenging IMHO. Working in full float like EXR is awesome and makes it a LOT easier.

              Comment


              • #8
                yeah we have to work with cineon aswell
                but I also work with some oldtimers who are blind, and stuck in their narrow way. The only way can see these things is in terminology, but not in practical use.
                Dmitry Vinnik
                Silhouette Images Inc.
                ShowReel:
                https://www.youtube.com/watch?v=qxSJlvSwAhA
                https://www.linkedin.com/in/dmitry-v...-identity-name

                Comment


                • #9
                  Originally posted by Sawyer
                  I think one of the issues with the second technique is that many of use still use 8 bit images. I only recently started playing with floating point images and only after watching the linear conversation unfold.
                  I agree with that. Not all people need the advanced functionality of 16 bit images, especially when you do stills and the final output is very close to what the end result will be. I understand that with 16 bit images you have more control, but you also need to replace all your software with software that handles 16 bit images well. When for example you don't need video tools that often, you will probably use a very cheap or even free editing tool that most probably doesn't support 16 bit images.

                  For me, the first workflow works well, altough I really believe that the other two are better if you wanna go back and edit the original files. But if 99% of the time you don't have to go back, you loose time imo (and also disk space). I think for the semi professionals like me option 1 can be good too.

                  The main improvement is that you use gamma correction on your renderings to improve the lighting quality and to remove the need for tricks to lighten up dark parts of the image.
                  Aversis 3D | Download High Quality HDRI Maps | Vray Tutorials | Free Texture Maps

                  Comment


                  • #10
                    [quote=
                    The main improvement is that you use gamma correction on your renderings to improve the lighting quality and to remove the need for tricks to lighten up dark parts of the image.[/quote]


                    I think it is very important to understand where the grey actually is in an image. Many picts I see have totally lost the middle tones and people need to know what is happening and that they don't need to over light. Thats the main thing. ANd what I like about this is I can keep 1 setting the same for ever. Now I never touch the color corrections and b/d multipliers. To me thats huge because I was spending too much time playing with those before.

                    Comment


                    • #11
                      question to vlado: vlado, you didnt mention anything about 0.4545?
                      Dmitry Vinnik
                      Silhouette Images Inc.
                      ShowReel:
                      https://www.youtube.com/watch?v=qxSJlvSwAhA
                      https://www.linkedin.com/in/dmitry-v...-identity-name

                      Comment


                      • #12
                        all of my clients use my work for print. so whats the point in going thorugh all this hoopla when i can just render what i know will be good since what i see on my screen is what i see in a print.

                        ---------------------------------------------------
                        MSN addresses are not for newbies or warez users to contact the pros and bug them with
                        stupid questions the forum can answer.

                        Comment


                        • #13
                          da elf, I think its beyond the point of how it looks on your screen. I mean, if your pipeline is established and it works well then go with it. But for us, not until recently the result from vray was not satisfactory;
                          we were constantly fighting with colors, trying to understand why the result was eather dark, or colors oversaturated. The gamma correction way has changed all that. Now, I can get photorealistic renders in about 3rd of the time it took me before.
                          Dmitry Vinnik
                          Silhouette Images Inc.
                          ShowReel:
                          https://www.youtube.com/watch?v=qxSJlvSwAhA
                          https://www.linkedin.com/in/dmitry-v...-identity-name

                          Comment


                          • #14
                            Originally posted by Morbid Angel
                            question to vlado: vlado, you didnt mention anything about 0.4545?
                            Yeah honestly this was a bit over my head. I get lost with look up tables I may even be using them I don't know.

                            What I am able to figure out is that if I burn in gamma correction this works for a regular image but if I am saving to an .exr or .hdr the correction is native to the file type. Then I don't burn the image (gamma correction 1/.4545) I apply the temporary image filter (vray frame buffer level correction).

                            Thats what I know. I wish I understood more but I don't. Vlado and Chris are more than adquate teachers but sometimes I wish they would talk a bit slower, a little louder, use smaller words and pat my head a bit more.

                            Comment


                            • #15
                              Originally posted by Da_elf
                              all of my clients use my work for print. so whats the point in going thorugh all this hoopla when i can just render what i know will be good since what i see on my screen is what i see in a print.
                              Well let me put it this way... do you use photoshop? I am sure you do or something that can in fact read HDRI or EXRs. So why not render in float then take it to photoshop and be able to adjust the exposure after the render? THEN save it as 8 bit if you want.

                              Comment

                              Working...
                              X