PDA

View Full Version : gamut control like in G2?



erikals
06-21-2010, 08:08 PM
hi, anyone knows is this is doable in LW?

http://www.worley.com/Media/images/html/g2/gamut_clip.html

RebelHill
06-22-2010, 03:38 AM
surely thats just some automatic tonemapping G2s doing... no?

erikals
06-22-2010, 04:26 AM
not sure,

it's a very nice feature,
if anyone has an idea on how to do it in LW.... that'd be King http://erikalstad.com/backup/anims.php_files/king.gif

Captain Obvious
06-22-2010, 07:53 AM
It's actually quite easy. You'll need Denis Pontonnier's node pixel or image filter. If you use the pixel filter, set it to multithreaded/AA. This will control highlight edge anti-aliasing. If you use the image filter, highlight edge AA can still be a problem. The advantage of the image filter is that it's technically more "accurate" and it should be somewhat faster because it only needs to evaluate once per pixel, instead of once per AA sample. Generally, the pixel filter method should be fine though. Aaaanyway.

I can't actually share a node setup for it, because I'm at home and my own LW is still version 8. But basically, do this:

For a very simple global exponential exposure, use the following algorithm:

outputColor = inputColor / (inputColor + exposure)

Lowering the exposure value increases the brightness of the image, but no value will ever be greater than 1.0. It changes the image more dramatically than G2's method, but it can produce some really nice results and is quite easily tweaked as well. Especially when set to a threaded/AA pixel filter, as it shows up in the render progress view.

Now, how to do it with nodes? Add a render buffer node. This is in Denis node collections. Add a vector add and a vector divide node (add node>math>vector>...), as well a scalar constant (add>constant>...). The scalar constant is for controlling your exposure. Leave it at 1.0 to start off with.

Connect the Color output (or whatever it's called) from the Render Buffer node to input A in both the Divide and Add nodes. Connect the output of the Constant node to input B of the Add node, and then connect the Add node to input B of the Divide node. Then connect the output of the Divide node to the Color input of the Pixel Filter node. Ta-da, instant global exponential tone mapping! Do a few low-res test renders and tweak the value of the Constant node to taste. Just don't set it to zero.



I've been meaning to build a node setup for better exponential HSV tone mapping, but I haven't gotten around to it yet. If I do, I'll share it here. :)

gerardstrada
06-22-2010, 10:06 AM
hi, anyone knows is this is doable in LW?

http://www.worley.com/Media/images/html/g2/gamut_clip.html


Yep, we can get the same functionality with DP_Exposure node:

http://imagic.ddgenvivo.tv/forums/Expossure.gif
Thank you very much to Denis Pontonnier for this node and for adding later the possibility to work with values below 1.0 for over-exposing images with a film look.

Guess a more appropriate name for this parameter in G2 is highlight rolloff or something like that. As far as it seems, it's an inverse exposure feature (similar to HDRExposure formula).

The difference in results between the inverse exposure and the clever suggestion of Captain Obvious (the simple global exponential exposure) is that the inverse exposure maintains intact the non-overexposed areas of the image, while the global exponential exposure works more like a tonemapping operator by dimming a bit the non-overexposed areas as well. You may want to try both options and see which fits more your needs according to the case.



Gerardo

Captain Obvious
06-22-2010, 06:57 PM
One major advantage of the global tone mapper is that it works on individual pixels, and disregards the surrounding image. Unless I'm mistaken, Denis' tonemap node is based on Reinhard tone mapping, which is *local*. This means you will not get the same results if you render a limited region, for example. Or is the DP_Exposure node a global tone mapper?

dpont
06-23-2010, 12:17 AM
Right, DP Filter Tone Map node is based on the rendered image,
could be compared to an 'automatic' diaphragm, may be good
for still rendered image or preprocessed background but
may be not what would expect a good photograph for
an image sequence and a lot of variation in luminosity.

DP Filter Exposure node will apply a contant 'inverse exponential
exposure' to the image and may be appropriate for an image sequence.

Given a basic Render Buffer Color -> Exposure Node -> Image Filter
node tree,
user should select and render an image 'key'
then read the 'Highest Luminance' shown in the panel info of
the Exposure node for applying a correct value.
Since the exposure value is also animated in the node,
user could select more than one key and mimics
a 'manual' diaphragm correction.

Denis.