HDR -> SDR conversion

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
User avatar
admin
Site Admin
Posts: 4382
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Fri Jul 20, 2018 9:23 am

Thanks for your comment, Dion. I would clarify that I am not seeking perfection.

User avatar
admin
Site Admin
Posts: 4382
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Fri Jul 20, 2018 3:13 pm

Narkyy wrote:
Thu Jul 19, 2018 6:39 pm
It's not that the sat parameter isn't good, it's just not enough to get colors close to v1.4 and madVR even with sat=1.25.
I find that I need sat=1.33 to match the madVR result for the red dress scene you are focused on. Here are my settings:

dghdrtosdr(sat=1.33,light=500,tm=0.9,roll=0.5)

Comparing this to madVR, I see no significant difference and nothing that motivates me to change anything. If you disagree please offer some objective evidence. Keep in mind that we will never achieve bit-for-bit identity.

Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR conversion

Post by Narkyy » Fri Jul 20, 2018 4:15 pm

Yes it does blend better, but then the color is not quite right.
It's more orange with saturation instead of a dark purplish red like it is already without adjusting saturation.

Made this to show more clearly.
1.7 is without saturation adjustment.

comparison2.png
comparison2.png (3.27 MiB) Viewed 1013 times

To me, there's a definite desaturation or hue change in the areas pointed by arrows and contained in lines drawn.
The arm isn't as purple, the bottom of the dress isn't as red, the background isn't as purple.
Some areas like the waist line looks fine, so it's like the darker red hue isn't on the entirety of the dress and just some parts.

It's also pretty clear to see where the red hue ends and desaturated/lower hue begins.
Last edited by Narkyy on Fri Jul 20, 2018 4:23 pm, edited 1 time in total.

User avatar
admin
Site Admin
Posts: 4382
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Fri Jul 20, 2018 4:20 pm

It is what it is. There is no way to argue that one is correct and the others are wrong, just as Dion pointed out.

User avatar
gonca
Distinguished Member
Distinguished Member
Posts: 705
Joined: Sun Apr 08, 2012 6:12 pm

Re: HDR -> SDR conversion

Post by gonca » Fri Jul 20, 2018 4:33 pm

Which is closer to the HDR or SDR (blu ray) source
V1.4, V1.7, MadVR?
No source so it can't be determined
This is starting to be a discussion of which looks better to me on this particular sample
I believe the idea was to have a solution that was good overall with the flexibility to be adjusted for certain cases
No offense meant to anyone, but lets get real

MadVR is good but I don't believe it is perfect either

Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR conversion

Post by Narkyy » Fri Jul 20, 2018 7:20 pm

You're right, though not everyone likes using SDR as "source" for HDR tonemapped content.
Neither look like SDR in terms of colors, in scenes where red is prominent.

What's objectively different though, is the level of details retained in those high saturation/hue areas.
They seem to get blurred and grain lost.

Image Image

Frame 42.
Sample: https://mega.nz/#!MctgWKRR!5ZaekqyMeKK6 ... R8Rrmxrabk

Also for some odd reason, every time I generate a new frame the detail is shifted above the right eye. :scratch:

Though I'm not sure it's something possible to improve, thank you :salute:

User avatar
admin
Site Admin
Posts: 4382
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Fri Jul 20, 2018 7:38 pm

Narkyy wrote:
Fri Jul 20, 2018 7:20 pm
Also for some odd reason, every time I generate a new frame the detail is shifted above the right eye. :scratch:
I don't know what you mean by "generate a new frame".

Grain difference may be accounted for by madVR dithering.

Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR conversion

Post by Narkyy » Fri Jul 20, 2018 10:08 pm

When I refresh in AvsPmod (so it does all the processing again and outputs the same frame), the image isn't identical as it was before.
Which is supposed to be expected?

I just tested it again on madVR and it seems indeed to be caused by the setting "restore details in compressed highlights", which also changes the red to purple in this sample.
No idea what happens behind the option though.

DGHDRtoSDR is still noticeably smoother, especially if you compare the right eye.
And I can't find a setting that makes madVR closer.

Example, in order: v1.7 | madVR | madVR restore details in compressed highlights

Image Image Image

So v1.7 is actually spot on here, except for the middle of the face where's it's not blending with the colors and clipping is noticeable on the edges.

Tried old DGReinhard/DGHable and HDRTools, all look worse so madVR might just be doing something funky.
The detail is definitely there though.

User avatar
admin
Site Admin
Posts: 4382
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Sat Jul 21, 2018 9:32 pm

MadVR has a boatload of "picture improvement" features. For an Avisynth filter I prefer to give the plain vanilla SDR conversion and allow the user to do any desired post-processing using Avisynth filters.

I've run DGHDRtoSDR on many of the Masciola test patterns and I don't see any issues other than the slight desaturation that can be easily corrected if desired with the sat parameter. So at this point, I consider that I have met my design goals for this filter and it is ready for serious use.

The current design is actually totally ignorant of the 709 gamut boundary! I am working for fun and learning on a version that explicitly uses the gamut boundaries. Here is a picture of the two gamuts for green. White is the larger 2020 gamut (shown as all white because 2020 colors cannot be displayed on a 709 monitor), green is the 709 gamut. The y axis is lightness and the x axis is saturation. These gamuts were obtained by Monte Carlo sampling of the lightness/saturation space with a fixed hue.

gamuts.png
gamuts.png (228.63 KiB) Viewed 949 times

My idea is to do 2D warping to transform the 2020 gamut to the 709 gamut, using a sparse warp representation consisting of a set of corresponding points (vertices and other points on the gamut boundaries). This warping will define the transformation of lightness and saturation for each 2020 color. The hue space will be sampled at (say) 1 degree intervals.

http://groups.csail.mit.edu/graphics/cl ... orph_6.pdf

Dion
Posts: 21
Joined: Sun Dec 04, 2016 1:30 am

Re: HDR -> SDR conversion

Post by Dion » Sun Jul 22, 2018 3:31 pm

Is it possible to have your plugin not take everything straight to 8bit? Like a bits="10" command or something?

Post Reply