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.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th November 2021, 06:06   #1  |  Link
wswartzendruber
hlg-tools Maintainer
 
wswartzendruber's Avatar
 
Join Date: Feb 2008
Posts: 412
How Do I Scale Luminosity?

Let's say I've got a HDR10 movie which grades reference white at 100 nits. Well, let's also say I want that level of brightness to be at 203 nits instead.

Right now, I'm naively multiplying linear display brightness by the required factor (203/100). This looks mostly fine, but BT.2390 is talking like I also might want to consider gamma correction here.

Now, this makes sense. The artistic difference between 100 vs. 50 nits is not the same as 10,000 vs. 5,000 nits, which would be the result of my current approach.

So how do I perform this gamma correction? I can't seem to find anything on it.
wswartzendruber is offline   Reply With Quote
Old 11th November 2021, 20:25   #2  |  Link
wswartzendruber
hlg-tools Maintainer
 
wswartzendruber's Avatar
 
Join Date: Feb 2008
Posts: 412
I'm noticing that BT.1886 doesn't seem to take this into account when converting BT.709 relative brightness to a given nit value. Ratios between relative brightness levels remain consistent.

If gamma correction indeed needs to be done, then BT.1886 shouldn't be doing this.
wswartzendruber is offline   Reply With Quote
Old 12th November 2021, 00:22   #3  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 570
In this case you're on the PQ scale.
In the [0, 1] scale: 100 nits = 0.508078, 203 nits = 0.580689, etc.

I don't think it would look good with a simple multiplication, though.
You have to take into account colors and how they're affected by the new brightness.
__________________
LG C2 OLED | GitHub Projects

Last edited by quietvoid; 12th November 2021 at 00:25.
quietvoid is offline   Reply With Quote
Old 12th November 2021, 01:18   #4  |  Link
wswartzendruber
hlg-tools Maintainer
 
wswartzendruber's Avatar
 
Join Date: Feb 2008
Posts: 412
I'm scaling the display linear RGB channels separately.
wswartzendruber is offline   Reply With Quote
Old 12th November 2021, 06:39   #5  |  Link
wswartzendruber
hlg-tools Maintainer
 
wswartzendruber's Avatar
 
Join Date: Feb 2008
Posts: 412
I think what i want is in BT.2446-0 section 4.1.2.

"Gamma compensation and scaling"
wswartzendruber is offline   Reply With Quote
Old 20th November 2021, 02:00   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
In general you don't want to do math on PQ code values. They're even more nonlinear than gamma, and weird things happen.

Linear scaling of nits isn't that bad a way to adapt to brighter ambient light conditions, since PQ itself is defined relative to a 10 nit ambient. It's certainly better than trying to scale or add to PQ code values.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 30th November 2021, 06:05   #7  |  Link
wswartzendruber
hlg-tools Maintainer
 
wswartzendruber's Avatar
 
Join Date: Feb 2008
Posts: 412
Is there even a correct way to do this, or is it subjective?

Right now my procedure is:

1. Take display linear RGB.
2. Convert to XYZ.
3. Convert to yxY.
4. Scale Y value.
5. Convert back to XYZ.
6. Convert back to display linear RGB.
7. Gamma compensation of some kind???

I'm also staring at CIE L*a*b* and wondering if that can't help.
wswartzendruber is offline   Reply With Quote
Old 4th December 2021, 05:10   #8  |  Link
wswartzendruber
hlg-tools Maintainer
 
wswartzendruber's Avatar
 
Join Date: Feb 2008
Posts: 412
I just did some experimentation with multiplying linear light and comparing that to gamma curves.

Linear multiplication of luminosity does indeed appear to be correct.

Last edited by wswartzendruber; 4th December 2021 at 05:12.
wswartzendruber is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.