Page 7 of 24

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 8:31 am
by admin
Thanks for the explanation, Selur. :salute:

Re: HDR -> SDR tonemapping for DGDecodeNV

Posted: Sun Mar 25, 2018 9:35 am
by Guest
admin wrote:
Sun Mar 25, 2018 6:49 am
@gonca

I see you are linking from the web for your images. Are you able to attach them to your post instead? Then they would be here permanently. If it is not working I can fix it.
Will do from now on

Re: HDR -> SDR tonemapping for DGDecodeNV

Posted: Sun Mar 25, 2018 9:57 am
by dmcs
admin wrote:
Sun Mar 25, 2018 7:39 am
OK, boys and girls, please re-download to get DGTonemap 1.1. It should significantly improve the whites and be much closer to the SDR versions. You can tweak it further if desired using the contrast and bright parameters.
Thank you for the update. Could you please tell me the default values of "contrast" and "bright" in the new version?

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 10:37 am
by Nginx
Thanks for the update.
Is that tonemap1.1 txt file readable? looks like I have some encoding issue(I asume its not utf8?). Random code showed on my sublimetext..

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 10:38 am
by admin
dmcs wrote:
Sun Mar 25, 2018 9:57 am
Thank you for the update. Could you please tell me the default values of "contrast" and "bright" in the new version?
Good point. :facepalm:

contrast = 0.3
bright = 3.0

I have updated the help file.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 10:41 am
by admin
Nginx wrote:
Sun Mar 25, 2018 10:37 am
Thanks for the update.
Is that tonemap1.1 txt file readable? looks like I have some encoding issue(I asume its not utf8?). Random code showed on my sublimetext..
I don't know what was up there because I just replaced it. Can you re-download and check again? Thanks. Should be UTF8. Works fine with sublimetext for me.

I'm trying to do too many things at once, gotta slow down. :P

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 11:00 am
by Guest
admin wrote:
Sun Mar 25, 2018 10:38 am
dmcs wrote:
Sun Mar 25, 2018 9:57 am
Thank you for the update. Could you please tell me the default values of "contrast" and "bright" in the new version?
Good point. :facepalm:

contrast = 0.3
bright = 1.0

I have updated the help file.
Thank you
Edit
Help file shows bright=3.0 as default

Too many things at once
Gotta slow down

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 11:17 am
by admin
Yes, 3.0 is the default. Post edited. Thank you.

Re: HDR -> SDR tonemapping for DGDecodeNV

Posted: Sun Mar 25, 2018 11:44 am
by admin
gonca wrote:
Sun Mar 25, 2018 9:35 am
Will do from now on
Sweet. :salute:

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 12:38 pm
by dmcs
I mess around the "bright" parameter, but cannot see any difference between the values (default, 1.0, 5.0).
Not sure where I did wrong.
Here's my script:

Code: Select all

DGSource("br2049.dgi", crop_t=280, crop_b=280, fulldepth=true).Spline36Resize(1920, 800)
z_ConvertFormat(pixel_type="RGBPS", colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none")
DGTonemap(bright=5)
z_ConvertFormat(pixel_type="YV12", colorspace_op="rgb:linear:2020:l=>709:709:709:l", dither_type="ordered")
Subtitle("bright=5.0", size=25)

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 1:17 pm
by admin
I know what's wrong, standby. Thank you.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 1:40 pm
by admin
Re-download, should be all fixed up. Thanks for pointing it out.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 2:10 pm
by admin
Higher numbers reduce brightness, you can even go to bright=1000 and beyond, but it stops having an effect up there. bright=3.0 is already too bright. Maybe 4.0 is better. It's logarithmic. Let me know what default you like. I'm also going to look at Hable and some local operators. Tonemapping raises some interesting philosophical questions regarding what features of perception should be favored, given that we cannot retain all of the information.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 2:49 pm
by Narkyy
So I'm trying to test the DGTonemap plugin without DGSource (as I don't have a HEVC decoding GPU).
I'm not sure what the plugin expects as input. As 16 bit source, it returns double the height but a proper image at the top.
This is my script (cropping the bottom)

Code: Select all

LSMASHVideoSource("source.mp4", stacked=true, format="YUV420P16")
z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none")
dgtonemap(contrast=0.2, bright=7.0)
z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
crop(0,280,0,-2440)

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 2:59 pm
by admin
Welcome to the forum!

That's probably some hacky high-bit depth support in LSMASH, i.e., it's that double-image nonsense done for use with Avisynth 2.6, which doesn't have native 16-bit support. I can't support hacks like that. Ask the LSMASH guys for real 16-bit support. We are in the UHD era.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 3:10 pm
by Narkyy
Hmm alright, thanks.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 3:20 pm
by admin
It's like going out of your way to support Windows 3.0 or XP.

1050 Ti's are very reasonable if you shop around. Around $180.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 4:53 pm
by Guest
sdr
1 sdr.jpg
bright=4.0
bright=4.0.jpg
bright=5.0
bright=5.0.jpg

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 5:02 pm
by admin
Nice, thanks gonca. I like bright=5. The SDR one is too dark in the shadows compared to bright=5, IMHO.

Re: HDR -> SDR tonemapping

Posted: Sun Mar 25, 2018 5:07 pm
by Guest
If you want me to further test with different samples let me know

Re: HDR -> SDR tonemapping

Posted: Mon Mar 26, 2018 2:27 am
by DJATOM
Narkyy wrote:
Sun Mar 25, 2018 2:49 pm
So I'm trying to test the DGTonemap plugin without DGSource (as I don't have a HEVC decoding GPU).
I'm not sure what the plugin expects as input. As 16 bit source, it returns double the height but a proper image at the top.
This is my script (cropping the bottom)

Code: Select all

LSMASHVideoSource("source.mp4", stacked=true, format="YUV420P16")
z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none")
dgtonemap(contrast=0.2, bright=7.0)
z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
crop(0,280,0,-2440)
You can tell AviSynth+ about stacked things, but in your case you don't even need to spend cycles on conversion, just something like

Code: Select all

LSMASHVideoSource("source.mp4", format="YUV420P16")
ConvertFromDoubleWidth(16)
z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none")
dgtonemap(contrast=0.2, bright=7.0)
z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
crop(0,280,0,-2440)
should work for you.

Re: HDR -> SDR tonemapping

Posted: Mon Mar 26, 2018 4:28 am
by admin
Cool, thanks for notifying us about that possibility. I'd never heard of that.

Re: HDR -> SDR tonemapping

Posted: Mon Mar 26, 2018 5:24 am
by Narkyy
Unfortunately that only made the width 1920, there was still garbage in the extra bottom 2160 pixels.
This is what worked though if anyone's interested: ConvertFromStacked(16) and crop(0,280,0,-280)
I'm not sure why but that works and it doesn't when LSMASH loads as stacked=false

Thanks for the help, I'll probably post some test samples soon :)

Re: HDR -> SDR tonemapping

Posted: Mon Mar 26, 2018 9:32 am
by admin
Maybe DJATOM knows something about that.

@all

I released a new version of DGTonemap that adds the Hable operator. Read the
DGTonemap.txt file as the usage has changed. Hable seems to preserve details
better to my eye.

http://rationalqm.us/DGTonemap.rar

Re: HDR -> SDR tonemapping

Posted: Mon Mar 26, 2018 1:18 pm
by DJATOM

Code: Select all

LwlibavVideoSource("D:\ACCEL_WORLD_INFINITE_BURST_UHD\BDMV\STREAM\00004.m2ts")
ConvertFromDoubleWidth(bits=10)
ConvertBits(16)
That way I get native 16 bit video (checked with ConvertBits(8,dither=0) and ConvertToStacked(), both produce valid output for me.