View topic - Tone mapping awareness-raising thread

Tone mapping awareness-raising thread

General discussion on lighting, backgrounds, Global Illumination, rendering parameters and tonnemapping.

Re: Tone mapping awareness-raising thread

Post Thu Aug 27, 2009 10:14 am

Renders using the aforementioned workflow:

original.png
Original Render

tonemmaped2.png
Tone mapped, Reinhard '05
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Tone mapping awareness-raising thread

Post Fri Aug 28, 2009 11:59 am

Hi,
I see your point about saving with 2.2 output , that way you don't need 2 files (all apps that expect linear hdr and apply gamma correction by default can be set to use a 2.2 gamma file. but the opposite is not always true)

Regarding the gamma correction in qtpfsgui levels window :
i hadn't considered that ... 'destructive operation' means that gamma (or levels) adjustments on LDR pictures leave empty gaps in the histogram and result in banding ?

I don't think that happens in this case , qtpfsgui applies 'levels adjust' to the tonemapping output : that output is no longer "hdr" in terms of luminosity range, but still 32 bits floating point : it has enough precision (steps) to avoid banding .
i tried that with reinhard : setting brightness very low, i get a black pic , but in 'adjust levels' i can still get the whole picture back ..so floating point data is still there.
i checked the output jpg in gimp and the histogram had no gaps .. that's what you said would happen , no? am i missing something ?
Anyway i'm not suggesting to do big changes to gamma (midtones slider) in adjust levels , it will make oversaturated and contrasted images (normal behaviour of gamma correction) that is not the way to significantly change /boost / dim lighting. Tonemappers do a much better work for that.
What if find useful of adjust levels is to tweak black point and white point to fine tune contrast..
User avatar
nizu
 
Posts: 24
Joined: Fri Mar 13, 2009 10:17 am
Location: Torino , Italy

Re: Tone mapping awareness-raising thread

Post Fri Aug 28, 2009 5:13 pm

'destructive operation' means that gamma (or levels) adjustments on LDR pictures leave empty gaps in the histogram and result in banding ?


Yes, al least with Reinhard 05, if I use Adjust levels tool, later in the image editor I get gaps in the histogram.Check this in your image editor:
Attachments
tonemmaped9.png
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Tone mapping awareness-raising thread

Post Fri Aug 28, 2009 7:27 pm

this is what i see in gimp : (top histogram)
histograms ok top  - excessive levels adjust bottom.jpg

Top looks fine , no ? it's not perfectly smooth ..but that's fine.
Bottom shows the kind of 'gaps' i knew (as syntoms of excessive gamma operations) this one was made from your pic applying a strong curve (shaped as 3 stair steps to exagerate contrast in luminosity ) resulting pic is oversaturated and burnt... but even if it looked ok ,those gaps mean that the ldr has not enough informations to correctly display the pic with that gamma or curve, and you could get better, smoother results doing that on an hdr.
(applies to operations on gamma , levels or curve)
Afaik, it's the totally empty bars that must be avoided ..is there something else ?
(or maybe i'm just not visualizing the first histogram correctly ?)
User avatar
nizu
 
Posts: 24
Joined: Fri Mar 13, 2009 10:17 am
Location: Torino , Italy

Re: Tone mapping awareness-raising thread

Post Fri Aug 28, 2009 8:09 pm

nizu wrote:this is what i see in gimp : (top histogram)
histograms ok top - excessive levels adjust bottom.jpg

Top looks fine , no ? it's not perfectly smooth ..but that's fine.
Bottom shows the kind of 'gaps' i knew (as syntoms of excessive gamma operations) this one was made from your pic applying a strong curve (shaped as 3 stair steps to exagerate contrast in luminosity ) resulting pic is oversaturated and burnt... but even if it looked ok ,those gaps mean that the ldr has not enough informations to correctly display the pic with that gamma or curve, and you could get better, smoother results doing that on an hdr.
(applies to operations on gamma , levels or curve)
Afaik, it's the totally empty bars that must be avoided ..is there something else ?
(or maybe i'm just not visualizing the first histogram correctly ?)

The ¨Adjust Levels¨ option from Qtpfsgui panel is for a Low Dynamic Range

I think the purpose of Tonemapping is to save the HDR image in a non HDRI format after some adjusts... right?. Reducing the range imply inevitably some lose of information. This ¨adjusts¨ are not destructive if are saved in a HDRI format, like EXR, logluvTiff, RGBE or HDRI. The PNG format is losseless but no HDRI and so the gaps appear on the Histogram because you have to adjust the information to a low range color.
Gimp doesn´t have support for HDRI images jet

To work on an image with Qtpfsgui
-save the Yafaray result image render in EXR format
-open the EXR file with Qtpfsgui
- click on ¨ToneMap the HDR¨ button and set the PreGamma value to 1/Gamma (the gama value from Yafaray Settings). Then adjust the levels with Rainhard 05 (Brightness, Chromatic Adaptation, Light adaptation). After Apply changes, save the Image on a non HDRI format as PNG or JPG.


:)

http://www.anyhere.com/gward/hdrenc/hdr_encodings.html

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Tone mapping awareness-raising thread

Post Fri Aug 28, 2009 9:16 pm

Hi,
I agree with what you say Condar , but there's a peculiarity in this case i believe (qtpfsgui adjust levels)
"The ¨Adjust Levels¨ option from Qtpfsgui panel is for a Low Dynamic Range "

yes, but ..
"Reducing the range imply inevitably some lose of information"

i'm not sure that is a problem : qtpfsgui adjust level still operates on 32 bit floating point data.

I think we should divide the concept of "HDR" as "a pic with a range of luminosity bigger than what monitors can display" from the more generic concept of "32 bits per pixel floating point" : that is an image that can be hdr or can already have been tonemapped to display on screen .
But " 32 bit floating point data" still means that you have so many precise "steps" (resolution) in luminosity that you can do all sorts of extreme curves / gamma operations without seing any banding ...
You have indeed lost the "High dynamic range" but not the resolution
(i think what would be wrong is to apply tonemappers twice : operators expect a "raw" pic with linear luminosity and will give unexpected results otherwise )

So in my previous post: top graph looks to me like a correct example of an LDR saved from Qtpfsgui ... it doesn't show banding (unless i'm not seeing the graph close enough or there is some other problem than banding-gaps)
The bottom graph is just a generic sample of banded pic with gaps in histogram. (indeed gimp doesn't handle 32 bpp so an extreme curve or levels destroys any pic ..even if it was "healty" before :D )

"This ¨adjusts¨ are not destructive if are saved in a HDRI format"

Imho not exact .. adjusts are non-destructive if performed on hdr (actually , generic 32bpp) , then you can save as a fine LDR.
Of course , if you save as exr,hdr etc.. you can further adjust (32 bpp 'resolution') if saved as 8 bpp further adjust will damage the pic (banding , gaps)
User avatar
nizu
 
Posts: 24
Joined: Fri Mar 13, 2009 10:17 am
Location: Torino , Italy

Re: Tone mapping awareness-raising thread

Post Fri Aug 28, 2009 9:58 pm

nizu wrote:... indeed gimp doesn't handle 32 bpp so an extreme curve or levels destroys any pic ..even if it was "healty" before :D )


lol... :)

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Tone mapping awareness-raising thread

Post Sat Aug 29, 2009 8:27 am

This is the histogram I get. It is not a big destruction, but it depends of the amount of level adjustments done, it can be worse than this:
Attachments
histogram.jpg
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Tone mapping awareness-raising thread

Post Sat Aug 29, 2009 11:11 am

oops :)
i accidentally downloaded the 400x300 thumbnail of your pic , not the original :oops:
Scaling filter must have filled the gaps (a little blur 'filled' those tiny gaps)
Looking at the original i get your same graph
(btw, my post and Samo's showed the same graph only mine is displayed linear and his logarythmic :so they looked different but was same pic , apart the gaps)

Still, the fact that you can 'get back' information from black or white areas must mean something : i still believe that qtpfsgui adjust is performed in 32 bit (so more powerful and accurate than 8bpp ,like in gimp)
(EDIT: the example i made was: use reinhart05 with very low brightness (<-10) you get a black pic. but you can 'get back' the pic lowering the whitepoint slider.. no practical use but ,as a test, means you still have floating point data ..)

The difference may be in the source hdr : (i'm guessing..) could render engines calculate luminosity with different resolutions (more or less decimals) ?
I haven't seen totally empty gaps in my tonemapped hdrs yet , but a yafaray ao render showed some banding ..i had never seen it in real cameras hdrs , vray or lux renders. But i'm not sure i must check more pics..
User avatar
nizu
 
Posts: 24
Joined: Fri Mar 13, 2009 10:17 am
Location: Torino , Italy

Re: Tone mapping awareness-raising thread

Post Sat Aug 29, 2009 5:29 pm

nizu wrote:oops :)
(btw, my post and Samo's showed the same graph only mine is displayed linear and his logarythmic :so they looked different but was same pic , apart the gaps)

Still, the fact that you can 'get back' information from black or white areas must mean something : i still believe that qtpfsgui adjust is performed in 32 bit (so more powerful and accurate than 8bpp ,like in gimp)
(EDIT: the example i made was: use reinhart05 with very low brightness (<-10) you get a black pic. but you can 'get back' the pic lowering the whitepoint slider.. no practical use but ,as a test, means you still have floating point data ..)

The difference may be in the source hdr : (i'm guessing..) could render engines calculate luminosity with different resolutions (more or less decimals) ?
I haven't seen totally empty gaps in my tonemapped hdrs yet , but a yafaray ao render showed some banding ..i had never seen it in real cameras hdrs , vray or lux renders. But i'm not sure i must check more pics..


Now I see the problem.... If you save the image after adjust the Reinhard parameters from Qtpfsgui without adjust the Gamma levels, the gaps don´t appear (not destructive). The Adjust levels button in Qtpfsgui is only available after Apply the filter and any subsequent change to Gamma Levels are made on a Low Range Image (the result after apply Filters to a HDRI). In this case the gaps appear (destructive or not healthy adjust :) )in the Histogram.

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Tone mapping awareness-raising thread

Post Mon Aug 31, 2009 6:10 pm

Hi,
i've made a pic showing what i usually do (steps 1 and 2) i never had troubles this way
There's also an example of the 'histogram gaps' problem ("for comparison" box) .. obtained by doing levels in gimp , instead of qtpfsgui .. no doubt it's wrong. But the question is, can the same gaps problem happen with the first method (steps 1 and 2) ? in what cases ?

Screenshot.jpg


If i understood correctly Samo used basically the same method as me (steps 1 and 2) but got the gaps problem.
I can't understand why.

I suggested the cause could be the rendering method : but I couldn't produce an exr causing the problem, this pic is yafaray direct+ao and worked fine..

Btw, this image (durand , lack of contrast) is different from my previous example (reinhart , dark pic) , but this case is more practical/ realistic : you can tweak brightness in reinhart with a slider (no need for levels) but , with all TMOs , a bit of black / white clipping is often useful...Anyway, technically both cases are same process ...
User avatar
nizu
 
Posts: 24
Joined: Fri Mar 13, 2009 10:17 am
Location: Torino , Italy

Re: Tone mapping awareness-raising thread

Post Mon Aug 31, 2009 6:39 pm

I think the problem here is the Gamma Correction on a Low Range Image... from the Qtpfsgui Manual...

¨NOTE: the post-gamma operation (typical of previous versions of Qtpfsgui) can be performed via the "Adjust Levels" button.
With the "Adjust Levels" button you can tweak the histogram of the current LDR image, the tool has been designed to be similar to the one in GIMP: you can drag the triangular handles to set the new value. ...
¨

The best choice to avoid gaps is only adjust pre gamma value and Reinhard levels (specially Brightness level), working only on the HDRI.

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Tone mapping awareness-raising thread

Post Mon Aug 31, 2009 6:41 pm

BTW... ¨High Dynamic Range Image Encodings¨ :)

http://www.anyhere.com/gward/hdrenc/hdr_encodings.html

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: Tone mapping awareness-raising thread

Post Thu Sep 03, 2009 7:26 am

I have updated the EXR section of the guide with some of the conclusions of this thread:
http://www.yafaray.org/documentation/us ... derout#exr

Thanks for your opinions on this.
User avatar
Samo
 
Posts: 3105
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Tone mapping awareness-raising thread

Post Tue Jun 15, 2010 8:34 pm

In feature film production, almost all image files "output" as linear.
With the exception of input texture files(sRGB), and deliver with log for .dpx.

I assume there is an option in blender that ask yafaray to covert texture from sRGB->Linear, or already done it automatically.

This way, when you preview things with many application, as long as it supports gamma correction for your display, you can still manipulate it safely in linear space. Until the moment that you think this is the result that I want, specify the output color space for your output device, be it jpg for website(usually sRGB), or other format(maybe non sRGB) for your print device.

Just remember one thing, all the tweaking(comp, color correction, tone mapping, etc) should be done within linear space. Whatever input(HDR probe, texture, etc) should be convert into linear before render(read your manual and see if renderer does it for you), render and then do your things with display correction. Only covert it for desire output device at final stage. Simple, straight forward, and proven to work.
reny
 
Posts: 14
Joined: Mon Jun 14, 2010 10:16 pm
Location: Vancouver, BC, Canada

PreviousNext

Return to Lighting and Rendering



Who is online

Users browsing this forum: No registered users and 3 guests

cron