Boulder
13th November 2017, 17:59
I wanted to compare the output of resamplehq and standard bicubic resizing.
Downloaded resamplehq for VS here:
https://gist.github.com/4re/64642122e359c37543fe
I added parameters a1 and a2 to the function so that I could utilize the b and c values of Bicubic resizing.
First I tested comparing this set:
org = core.fmtc.bitdepth(clp, bits=16)
clp = core.resize.Bicubic(org, width=1280, height=688, filter_param_a=-0.7, filter_param_b=0.35)
clp2 = core.resize.Bicubic(org, width=1280, height=688, filter_param_a=-0.4, filter_param_b=0.2)
planes = [0]
expr = ('{median} x + y -').format(median=1<<(clp.format.bits_per_sample-1))
expr = [(i in planes) * expr for i in range(1)]
result = core.std.Expr([clp, clp2], expr)
result = core.std.Levels(result, min_in=125*256, max_in=132*256, min_out=0, max_out=255*256, planes=0)
It created a nice comparison:
https://preview.ibb.co/neYytG/43462_bicubics.png (https://ibb.co/mtFBDG)
Then I replaced the second clip by clp2 = rhq.resamplehq(org, width=1280, height=688, a1=-0.4, a2=0.2)
This created some strange banding:
https://preview.ibb.co/h1dEYG/43462_rhq2.png (https://ibb.co/cjHmfw)
Is this an issue of fmtconv, which resamplehq uses extensively, or something else? Is there some other alternative to try to do gamma aware resizing?
Downloaded resamplehq for VS here:
https://gist.github.com/4re/64642122e359c37543fe
I added parameters a1 and a2 to the function so that I could utilize the b and c values of Bicubic resizing.
First I tested comparing this set:
org = core.fmtc.bitdepth(clp, bits=16)
clp = core.resize.Bicubic(org, width=1280, height=688, filter_param_a=-0.7, filter_param_b=0.35)
clp2 = core.resize.Bicubic(org, width=1280, height=688, filter_param_a=-0.4, filter_param_b=0.2)
planes = [0]
expr = ('{median} x + y -').format(median=1<<(clp.format.bits_per_sample-1))
expr = [(i in planes) * expr for i in range(1)]
result = core.std.Expr([clp, clp2], expr)
result = core.std.Levels(result, min_in=125*256, max_in=132*256, min_out=0, max_out=255*256, planes=0)
It created a nice comparison:
https://preview.ibb.co/neYytG/43462_bicubics.png (https://ibb.co/mtFBDG)
Then I replaced the second clip by clp2 = rhq.resamplehq(org, width=1280, height=688, a1=-0.4, a2=0.2)
This created some strange banding:
https://preview.ibb.co/h1dEYG/43462_rhq2.png (https://ibb.co/cjHmfw)
Is this an issue of fmtconv, which resamplehq uses extensively, or something else? Is there some other alternative to try to do gamma aware resizing?