Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Improve the Quality of Your Renders using Tone and Gamma Corrections

33

tongam2.jpgYou've rendered your scene and everything looks great! But, of course, there's usually more work to be done to really push the rendered results to something that can truly be called "finished". The subject of post-processing could fill volumes of books and many online resources often leave you with more questions than answers. Here's a tutorial on Tone and Gamma Corrections that should help to answer some of those questions.

This application-independent tutorial, created by Yves Poissant, explains why tone and gamma corrections of a 3D CG render are necessary and how to take this into consideration in all stages of its image production.

Yves writes:

Tone and Gamma correction is a very intricate issue. There is a fundamentally simple solution but because the issue is intricate, people don't usually inderstand it and don't want to apply it. Applying this simple solution, however, is one very important step toward getting realistic 3D renders. Every major studio knows that. They have lighting specialists that take care of that aspect for everybody working at every stage of producing a film and that includes FX and CG. But 3D CG artists are left to their own devices, trying to figure it by themselves.

There are a few rare tutorials about this issue on the web. Type "Linear workflow" in google to get a few samples. Invariably, they all seem to generate more questions than they answer. This is my experience too when I discussed the issue on the Hash Inc forum. So I tried to write this tutorial in a very systematic way, trying to answer the questions I saw in my discussions as I go.

tongam1.jpg

The tutorial covers:

  • Tone and Gamma correction
  • Gamma correction
  • 3D renders as a virtual camera
  • Dynamic range correction
  • Tone correcting 3D renders - Is it necessary?
  • Applying tone correction to a 3D rendered scene
  • Correcting the textures
  • Work environment for texturing
  • Tone correction aware textures
  • Conclusion

You can find the tutorial here, on Yves Poissant's website.

UPDATE: Further discussion and testing can be found at this blenderartists.org discussion thread.

33 Comments

  1. uh, i sure hope noone is doing gamma curve modifications on a 8-bit colorspace. The best possible way of destroying the picture information on the scene.

    All of this is very well and proper if you render your images to high dynamic range formats, (HDR,exr.. ) Anyways the renderer should internally work with floats and high dynamic ranges. To make an analog, the process of saving an 8bit image (jpeg) from a render and then modifying it would be like printing out a post card and then enlarging it with a photo copier to a poster size.

    Even with few of the example images in the article above you can see the banding effect that occurs when you try to gamma adjust a hot-spot that simply does not have the color information required to make the gradient smooth when the intensity drops.

    -lekonna

  2. It is not about what you think looks better. it is about obtaining results similar to what the eye sees.

    This would be very important for integrating 3D animation with live footage.

    lekonna:

    He says to use openexr in the article.

  3. I have a calibrated monitor (hardware calibrated) and I think the original image was quite ok. Sure, it looks artificial but thats not due to the tonal range, it's due to the cartoonesque character of the image itself. On his website, somehow all of his images are too bright and kind of pale...

    Matching CG and real footage can be done in many ways and I agree to the point that CG always has a tonal range that is larger than a photographic image. But this heavily depends on the camera system used. There are other things to keep an eye on as well, like grain, color cast, blur and lens abberations... But you have to do this only when mixing both media. As long as it's all CG you don't have to change the tonal range... At least this is my opinion... ;D

    Greets

  4. When matching CG elements to real life, this is useful, but if I were making a CG movie I would keep the first image. Any artist would, though; it's just a form of artistic license. Thanks for the article.

  5. The first may have a greater range in tone that's a bit more aesthetically pleasing (to some, anyway, not I), but the second is much more realistic.

    Thanks Bart, I really needed a site that offered printer calibration tips!

  6. Gamma correction in a calibrated monitor in Linux and MAC is 1.75.

    Gamma correction in a calibrated monitor in Windows is 2.2.

    The tutorial does not explain this and more or less assumes that 2.2 gamma is for all OS, which is not true

  7. Alvaro:

    The article says Mac uses 1.8 but with OSX it has a way to deal with 2.2 gamma corrected images.

    That said can you supply any info regarding gamma 1.75 and Linux. I looked but could not find any.

    Thanks

  8. A inverse gamma correction in a dark 8 bit texture, as explained in the tutorial, can eat much of the range, so this step should be handled by the render engine if supported. Also gamma corrections could mean another change in the histogram apart from loosing range, which is steps in the histogram curve, which can be solved aplying a gaussian blur to the texture.

    Also the tutorial does not explain that the inverse gamma correction should be also performed with other render input as lights colors and color background, as I did in my linear workflow tutorial, so I don't now how lights and backgr. different color it is corrected in this method, maybe with tone mapping adjustments.

    The linear workflow is just a little trick to center the range of a render according with that of your monitor, and exposure (tonne mapping) is another different issue I think.

    Anyway is a good reading.

  9. Hmm if you compare the 'from this' with the 'to this', the 'to this' looks much more brighter and realistic, but the window or the outside, which i think should be dark, because it is night, is to bright to be night. If you know what i mean ;). But i think that you need HDR to make the night dark and the room bright.

  10. Carl Complaint on

    Uh. Yes, you can fill entire books with any amount of stuff, but in the end, it all stays a matter of personal preference and taste (and a matter of whether you have the money to buy those books :)

    For me as a Very Simple Person, I just load the resulting render in Gimp 1.2.5 and do Brightness/Contrast ;)

  11. thanks for the article, he does provide lots of useful information. i think his point is well made, that monitor calibration will make a huge difference to how we interpret an image. his images are clearly made for 2.2 calibrated devices, and do look washed out to me as well, even on my calibrated monitor.

    are there specific controls for default gamma in blender? i have been working to adjust a series of images for print, and so far i have just been eyeballing them, but the results are anything but consistent. i need to develop a workflow within blender, that applies across platforms. any more helpful advice would be appreciated! : )

    thanks again!

    jim ww

  12. Yves Poissant on

    I wrote a reply earlier but it was flagged as spam (maybe because of a link to wikipedia page concerning the sRGB standard) and never showed up so I will try to do it again.

    To lekonna: You are right that every tone correction should be done on at least a 16-bits image file. Personally I use OpenEXR and I recommend using OpenEXR for that sort of correction. I don't recommend doing any sort of color correction on 8-bits images.

    To Alvaro: The old Mac used to have a gamma correction of 1.8 in their color lookup table. That caused color aliasing issues. In those days, the Mac was used for preparing printed graphics works and a gamma of 1.8 better matched the printer's transfer curves. Nowadays, this "printing process destination" is not assumed anymore on Macs, In fact Macs are quite often used to prepare and output for video. On my latest Mac, the large HD display had a gamma of around 2.1. The gamma correction, or more precisely, the OSS color correction is now handled on a per application level with the OSX color management subsystem. So an application doing work for the printing press will have a different color profile than an application preparing work for video.

    Anyway, the gamma 2.2 is not an OS dependent issue. It is a "standads" issue. The sRGB standard (search wikipedia for "sRGB standard") was designed so that every monitors have more or less the same base gamma so that everybody can view digital photos as they were intended to be seen. The sRGB although a bit more complex than a simple gamma curve amount to a gamma of approximately 2.2.

    When doing inverse gamma correction on 8-bits images, they should first be converted to 16-bits and all the color corrections done and saved on 16-bit images and files. Of course, given that a 8-bits image have limited color resolution to start with, it may still produce color banding but converting them to 16-bits first will at least avoid color quantization. Note that the same banding issues will show up if the reverse gamma corrections are handled from inside the renderer.

    I don't cover that lights should be reverse gamma converted too because I don't believe that this can be effectively automated. The whole idea of the issue is that we want to get a well balanced set of texturing an a good preview setup so that the lights can be visually adjusted with the proper feedback. My experience is that once you have linear textures and gamma corrected preview, any old lighting must be rethought completely because the light attenuation is different, the shading cosine falloff is different and the shadows are different too so just applying a reverse gamma formula to the lights colors and intensity will certainly not give the expected results. As for the background/environment, since they are also textures, they should be reverse gamma corrected too. I like to work with HDRI environment maps and those are already linear anyway so they don't need to be reverse corrected.

    To ColeZero: Yup! You are right, the background in the window should have been reverse gamma corrected too. I missed that one.

    To jim ww: Nice point you make here. Anybody looking at those two renders on a monitor with a gamma of 1.75 or 1.8 or whatever bright setting, will feel the second render is washed out. But that is only because the monitor is not calibrated to gamma 2.2.

    Unfortunately, Blender is limited in term of tools to help working in a linear workflow manner. What I currently do, is I put a "Gamma" node between the "RenderLayer" node and the "Viewer" node in the node editor. I set the gamma to 0.45 and I have the UV editor opened to view the "Viewer Node". I just need to remember to not press "F12" to render but to click on the "Re-render this layer" button on the "RenderLayer" node. This works well enough. I'd like to have material preview and the preview render overlaying window to be color corrected too. Another way to help solve the linear workflow in Blender would be to do the reverse gamma corrections from inside Blender. The reverse correction would need to be specifiable on a per material basis and/or on a bitmap basis since HDRI images cannot be gamm corrected and shoul not b reverse gamma correctedtoo.

    Final note: Of course, tone correction is foremost a personal preference thing. Gamma correction is just one way to correct a render. This will give renders that are a closer match to digital photos and films. So if someone want to make a composite with CG and photo, this would help. Also if someone's goal is to produce photorealistic renders, this type of correction will help get there. But artistic licence is a good justification for not using it or for tonecorrecting the other way and get much sharper contrasts.

  13. Yves Poissant on

    To ccherrett: For info on different gamma corrections on differet OSes and for just Gamma correction info in general, the best place to go is to Charles Poynton site. I would give the address but I think posting web addresses here i not allowed. Search for "Chales Poynton" on google.

  14. I don't understand... i use winXp - i looked at driver setup - and gamma was set to 1,0 - when i set it to 2,2 - all color look extreme bad - much brighter - so i reset it back to 1,0

    should i now set driver settings to 2,2 or rendered images to 2,2?

  15. btw, the best picture is (still) the upper, the lower looks pale, is cranked up that much, the detail is the highlight is completely gone... I stopped checking, I would sent it back... ;)

  16. Yves Poissant on

    To xry: The gamma setup widgets that can be installed on the computer or the ones that come with the graphics card drivers cannot be trusted in the sense that those application cannot see what the monitor phosphors truely output. What you need to do is use those gamma setup applications along with the help of a gamma chart and adjust the gamma slider so the gamma chart shows a gamma of 2.2. Use the procedure and gamma charts provided by Norman Coren. I give the web address in my tutorial.

    Also, different gamma setting applications interpret the gamma value differently. Some means the gamma correction applied on the monitor and your's is probably in that category, and other applications mean the required correction to correctly display an image with the gamma correction corresponding to the value selected.

    If your monitor have never been calibrated and your gamma seting indicates 1.0, then chances are that your monitor is curently set with its natural gamma which is around 2.4 - 2.5.

  17. Thank you for writing the tutorial, Yves, must have been a lot of work. I learned quite a few things from it I wasn't aware of before.

  18. When creating linear images, as the tutorial illustrates, I dont understand why he uses 3.0 gamma for the "gray" on his color profiling icc. Can somebody please explain the reason why someone would want to do that. He mentions why, (I think) but do not understand his explanation.

    Thank You

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×