Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#61 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
For HDR TV, HDR was suppose to look different from SDR, as it preserves detail on both highlight and shadow instead of "white" being blown out in SDR in comparison. But as a result, it will look washier and less contrast than SDR. You HDR result looks ok to me except for the saturation. |
|
![]() |
![]() |
![]() |
#62 | Link | |
Registered User
Join Date: Oct 2018
Posts: 338
|
Quote:
|
|
![]() |
![]() |
![]() |
#64 | Link | |
Registered User
Join Date: May 2005
Posts: 1,550
|
Quote:
__________________
Gorgeous, delicious, deculture! |
|
![]() |
![]() |
![]() |
#65 | Link |
Registered User
Join Date: Oct 2018
Posts: 338
|
I don't see those wrong colors in mpv, so the problem is in the script, not in the curve. It may be because the script is tone mapping the RGB channels instead of the luminance. I don't know what DGHDRtoSDR does in that sense, but it seems to be using the Reinhard TMO which is much simpler.
|
![]() |
![]() |
![]() |
#67 | Link |
Registered User
Join Date: May 2005
Posts: 1,550
|
Why would it need a parameter for that?! Preferably, it would find and extract the info on its own from the UHD Blu-Ray structure (DV layer and what not; or, if it needs a parameter per se, a location of the meta-data file).
__________________
Gorgeous, delicious, deculture! |
![]() |
![]() |
![]() |
#69 | Link |
Registered User
Join Date: Oct 2015
Posts: 54
|
I was testing the tonemapping using the hue-constant curves from adobe
https://github.com/Beep6581/RawThera.../curves.h#L919 https://github.com/Beep6581/RawThera.../curves.h#L974 Here's a new script tonemapping.py Code:
import vapoursynth as vs def tm_hable(clip="",source_peak=1000 ) : core = vs.get_core() c=clip source_peak=source_peak LDR_nits=100 exposure_bias=source_peak/LDR_nits o=c c=core.std.Limiter(c, 0) r=core.std.ShufflePlanes(c, planes=[0], colorfamily=vs.GRAY) g=core.std.ShufflePlanes(c, planes=[1], colorfamily=vs.GRAY) b=core.std.ShufflePlanes(c, planes=[2], colorfamily=vs.GRAY) lum = core.std.Expr(clips=[r,g,b], expr="0.216 x * 0.715 y * + 0.0722 z * +") lum=core.std.Limiter(lum, 0) lum=core.std.ShufflePlanes(lum, planes=[0], colorfamily=vs.RGB) rr="x {exposure_bias} * 0.15 x {exposure_bias} * * 0.05 + * 0.004 + x {exposure_bias} * 0.15 x {exposure_bias} * * 0.50 + * 0.06 + / 0.02 0.30 / - 1 {exposure_bias} 0.15 {exposure_bias} * 0.05 + * 0.004 + {exposure_bias} 0.15 {exposure_bias} * 0.50 + * 0.06 + / 0.02 0.30 / - / * ".format(exposure_bias=exposure_bias) gg="y {exposure_bias} * 0.15 y {exposure_bias} * * 0.05 + * 0.004 + y {exposure_bias} * 0.15 y {exposure_bias} * * 0.50 + * 0.06 + / 0.02 0.30 / - 1 {exposure_bias} 0.15 {exposure_bias} * 0.05 + * 0.004 + {exposure_bias} 0.15 {exposure_bias} * 0.50 + * 0.06 + / 0.02 0.30 / - / * ".format(exposure_bias=exposure_bias) bb="z {exposure_bias} * 0.15 z {exposure_bias} * * 0.05 + * 0.004 + z {exposure_bias} * 0.15 z {exposure_bias} * * 0.50 + * 0.06 + / 0.02 0.30 / - 1 {exposure_bias} 0.15 {exposure_bias} * 0.05 + * 0.004 + {exposure_bias} 0.15 {exposure_bias} * 0.50 + * 0.06 + / 0.02 0.30 / - / * ".format(exposure_bias=exposure_bias) r1 = core.std.Expr(clips=[r,g,b], expr="x y >= y z > {rr} z x > x y - z y - / {bb} {gg} - * {gg} + z y > {rr} {rr} ? ? ? x z >= x z - y z - / {gg} {bb} - * {bb} + z y > {rr} {rr} ? ? ? ".format(exposure_bias=exposure_bias,rr=rr,gg=gg,bb=bb)) g1 = core.std.Expr(clips=[r,g,b], expr="x y >= y z > y z - x z - / {rr} {bb} - * {bb} + z x > {gg} z y > {gg} {gg} ? ? ? x z >= {gg} z y > y x - z x - / {bb} {rr} - * {rr} + {gg} ? ? ? ".format(exposure_bias=exposure_bias,rr=rr,gg=gg,bb=bb)) b1 = core.std.Expr(clips=[r,g,b], expr="x y >= y z > {bb} z x > {bb} z y > z y - x y - / {rr} {gg} - * {gg} + {bb} ? ? ? x z >= {bb} z y > {bb} z x - y x - / {gg} {rr} - * {rr} + ? ? ? ".format(exposure_bias=exposure_bias,rr=rr,gg=gg,bb=bb)) crgb=core.std.ShufflePlanes(clips=[r1,g1,b1], planes=[0,0,0], colorfamily=vs.RGB) lumtm = core.std.Expr(clips=[r1,g1,b1], expr="0.216 x * 0.715 y * + 0.0722 z * +") lumtm=core.std.Limiter(lumtm, 0) lumtm=core.std.ShufflePlanes(lumtm, planes=[0], colorfamily=vs.RGB) clum = core.std.Expr(clips=[o,lum,lumtm], expr=" x {exposure_bias} * y {exposure_bias} * / z * ".format(exposure_bias=exposure_bias)) clum=core.std.Limiter(clum, 0) mask=core.std.Expr(clips=[lum,lumtm], expr=" x {exposure_bias} * y - abs {exposure_bias} 1 - / ".format(exposure_bias=exposure_bias)) mask=core.std.Limiter(mask, 0,1) ctemp=core.std.MaskedMerge(crgb, lumtm, mask) c=core.std.Merge(clum, ctemp, 0.5) return c http://screenshotcomparison.com/comparison/133859 http://screenshotcomparison.com/comparison/133858 http://screenshotcomparison.com/comparison/133861 It has only a parameter source_peak this is the usage of the script Code:
import tonemapping import vapoursynth as vs core = vs.get_core() c = core.ffms2.Source(source = 'C:/Users/.../videos/HDR.mp4') source_peak=1200 matrix_in_s="2020ncl" transfer_in_s="st2084" c=core.resize.Bicubic(clip=c, format=vs.RGBS, filter_param_a=0, filter_param_b=0.75, matrix_in_s=matrix_in_s,chromaloc_in_s="center",chromaloc_s="center", range_in_s="limited",dither_type="none") c=core.resize.Bilinear(clip=c, format=vs.RGBS, transfer_in_s=transfer_in_s, transfer_s="linear",dither_type="none", nominal_luminance=source_peak) c=tonemapping.tm_hable(c,source_peak=source_peak ) c=core.resize.Bilinear(clip=c, format=vs.RGBS, primaries_in_s="2020", primaries_s="709",dither_type="none") c=core.resize.Bilinear(clip=c, format=vs.RGBS, transfer_in_s="linear", transfer_s="709",dither_type="none") c=core.resize.Bicubic(clip=c, format=vs.YUV420P8,matrix_s="709", filter_param_a=0, filter_param_b=0.75, range_in_s="full",range_s="limited", chromaloc_in_s="center", chromaloc_s="center",dither_type="none") c.set_output() Last edited by age; 2nd May 2019 at 13:00. |
![]() |
![]() |
![]() |
#70 | Link | |
Guest
Posts: n/a
|
Quote:
|
|
![]() |
![]() |
#71 | Link | |
Registered User
Join Date: Jul 2012
Posts: 1,252
|
Quote:
|
|
![]() |
![]() |
![]() |
Tags |
hdr, sdr |
Thread Tools | Search this Thread |
Display Modes | |
|
|