• I have created a plugin that applies an autolevels effect to the krpano view:
    http://fieldofview.com/projects/krpano_autolevels

    The effect can be tuned to affect just the luminosity of the view, or the luminosity as well as the color of the view. Please note that the effect is applied to the (jpeg compressed) 8 bit panorama, so if the effect is too pronounced you will start to see artifacts such as banding and color mismatches. There is a number of parameters that will let you tone down the effect to suite your images.

    The autolevels effect achieves a similar effect to the Adaptive Dynamic Range concept (ADR) which I previously implemented in SPi-V, but instead of mixing dual exposures, it applies a color transform to the view after it has been drawn by krpano (but just before it is displayed on the screen). This has the advantage of being simpler to author, but has less control and less actual dynamic range than a full ADR implementation.

    The plugin requires Flash player 10 or newer. It can be used free of charge and its source code is available under a CC-GNU GPL license.


    The autolevels.swf file and its sources are available as part of the krpano_fovplugins package on github.

    Edited 2 times, last by ahoeben (March 15, 2011 at 4:55 PM).

  • Aldo,

    it really is wonderful that you would share this and I'm sure the entire KRPano community greatly appreciates your contributions. And if anyone is not familiar with Also's prior work, you should be if you want to get a better understanding of the 360 world, Aldo is an accomplished pioneer in this world.

    Now, I'm trying to understand the purpose of this plugin, that is, what you;re trying to do by building it. Is it to try and simulate the short lag that our vision has when you move from light to dark, that is the small adjustment time before one can see clearly once you've moved from light to dark or vice versa?

    Or am I missing the purpose?

    Best Regards,

    Robert

  • VN2009,

    the plugin is just using the final 8 bit jpg, so I think I can safety say that's not what this is for. Once you've gotten to a single 8 bit file, you have no headroom or dynamic range like you do in RAW. Sure you can lighten a dark area a bit, but you can not darken a blown out area, it will just go grey.

    regards,

    Robert

  • See the example here:
    http://fieldofview.com/projects/krpano_autolevels
    Look from the dark hallway into the bright sky, and you should see detail appear. The effect is subtle, and works best if you zoom in a bit. It is all about the effect, not about actually extending the dynamic range. But you'll see that if you have a panorama without blown highlights and without too dark shadows, that there is actually some "room" in the 8 bit image to play with the dynamic range.

    Another use of the plugin is for high resolution panoramas with a lot of haze. When zoomed out, the blue haze looks perfectly natural ("atmospheric perspective"), but when you zoom in to the hazy parts of the image near the horizon, the blue tint and lack of contrast will distract from the experience. The autolevels plugin should let you handle this in a nicer way.

  • Hi,

    ...there is actually some "room" in the 8 bit image to play with the dynamic range.

    *smile* So, come on and play *wink*
    To help in playing with the different attributes, I have made a little pluging that uses sliders to tweak the values. As it is based on the "slider-blend-cubes" example from Klaus, you have to retrieve the file "white.jpg". Here is the code:

    It is not a super good looking pluging, but a think it can help to find the right settings...
    Hope this can be useful... And thank you again Aldo for this great plugin *thumbup* .

    SAlut.

  • One word of caution: the plugin basically takes a screenshot of the view whenever the camera changes, and uses that screenshot to do the autolevels calculations. The sliders will be part of the screenshot, so they will be of some influence over the effect. I have shrunk down the ui, added some code so the sliders take their initial values from the xml, and added it to my sample. Thanks!

    update: see Klaus' remarks below.

    Edited once, last by ahoeben (August 26, 2010 at 10:26 AM).

  • Hi and welcome!

    thank you, a great plugin!

    just a short note about the todo note in your in the updateLevels function - the "image.layer" Sprite contains only the pano image, so any <plugin> or <hotspot> elements aren't visible on it when drawing it,

    and if you want to draw also the hotspots on it do something like this:

    Code
    this.meterbitmap.draw(this.panosprite,this.scalematrix);
    this.meterbitmap.draw(this.krpano.get("hotspot.layer"),this.scalematrix);

    best regards,
    Klaus

  • Hi Aldo,

    I have shrunk down the ui, added some code so the sliders take their initial values from the xml, and added it to my sample. Thanks!

    Yes, that's better *thumbup* ...

    Note: I have noticed that when an attribute it is not set inside the xml, some strange results could happen...
    ex:
    trace('plugin[autolevels].%1 = ',plugin[autolevels].%1)
    could return:
    plugin[autolevels].adaptation = plugin[autolevels].adaptation
    so:
    plugin[autolevels].adaptation = NaN

    To avoid this I have modified the loadslider() action:

    It seems to work now *smile* ...
    You will find the code in the attached zip file....
    Hope it is helpful...

    SAlut.

    edited: the code does not work properly... Sorry... *sad*

  • Hi Aldo,

    The reason I put the pow(val,3) in is because even though the range for "adaptation" is from 0 to 1, only small values give interesting results (ie: 0.001 - 0.2). With the amplification in place, it is easier to tune the adaptation to a low value.

    Ok, so I have modified the code on the loadslider() action to makes the sliders reflecting the amplification...

    Code
    if( %1 == adaptation , pow(val,0.33333333333333333333333333333333) );

    It seems that the plugin Autolevels.swf sets default values when no parameters are preset in the xml ... isn't it?...
    This has been confusing me a long time *wacko* ... Unless if the preload is set to true for plugin Autolevels.swf, some times they apply, some no *whistling* ...

    I think the code works correctly now *squint* ...

    SAlut.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!