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 > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th September 2020, 15:04   #1  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Levels: highlight cut off

Hello,

I do not understand why is this:
Code:
Levels(0, 1, 65280, 0, 65280, coring=false, dither=false)
is cutting off my highlights?

http://www.imagebam.com/image/7cf4ca1355130247

If I use this line
Code:
Levels(0, 1, 65280, 0, 235*256, coring=false, dither=false)
it keeps the highlight intact
http://www.imagebam.com/image/6309cc1355130248
but do I really need to do this to not loose my highlight information? I want to keep as much information as possible.

Thanks!

Last edited by anton_foy; 26th September 2020 at 15:10.
anton_foy is offline   Reply With Quote
Old 26th September 2020, 15:37   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
It's cut off by the limited range RGB conversion. The Y values are still there , you just don't "see" them in an RGB image

235*256 = 60160

In the 1st image, for 16bit values you have bright cloud values in the Y=60160-65280 range. (This is analogous to Y 235-255 in 8bit values when converted to RGB for display using limited range, they get clipped by the RGB conversion)

The 2nd example with levels depresses the output high to 60160 (analgous to 235 in 8bit) before the RGB conversion, so those values are not clipped, but the whole waveform is compressed from the top, so entire image is darker. This applies range compression from the top (squishes the waveform)

Last edited by poisondeathray; 26th September 2020 at 15:39.
poisondeathray is offline   Reply With Quote
Old 26th September 2020, 15:40   #3  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
@poisondeathray
Thanks so what would you suggest would be the best option to keep the info in the image as much as possible?
anton_foy is offline   Reply With Quote
Old 26th September 2020, 16:35   #4  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by anton_foy View Post
@poisondeathray
Thanks so what would you suggest would be the best option to keep the info in the image as much as possible?
Use float32 for processing.

But the more interesting question is why do you think you need to use the Levels function in the first place?

Also, out of curiosity what lens are you using?

Last edited by Cary Knoop; 26th September 2020 at 16:51.
Cary Knoop is offline   Reply With Quote
Old 26th September 2020, 17:14   #5  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Quote:
Originally Posted by anton_foy View Post
@poisondeathray
Thanks so what would you suggest would be the best option to keep the info in the image as much as possible?
Depends on what you want to do with it, and/ or how it's going to be viewed

If you're keeping it as limited range video, then definitely bring the "superbrights" down. But just compressing the highlights darkens the image. But maybe that's the look you're going for. Maybe not. Maybe you want to bring midtones up a bit . You have more control in other programs such as resolve or NLE's
poisondeathray is offline   Reply With Quote
Old 26th September 2020, 22:32   #6  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Cary Knoop View Post
Use float32 for processing.

But the more interesting question is why do you think you need to use the Levels function in the first place?

Also, out of curiosity what lens are you using?
Thanks, I will try to do the processing in 32 bit float (although I would suspect my computer cannot handle it until I upgrade as even in 16 bit my export crashes due to "out of memory").

Regarding levels, if I do not use it at all I get blown out highlights and the only solution I could come up with was this:
Levels(0, 1, 65280, 0, 235*256, coring=false, dither=false)

The lens is a Tamron 10-24mm f/3.5-4.5. Not so sharp but nice for the wide angles. In this test clip the focus is off tho.
anton_foy is offline   Reply With Quote
Old 26th September 2020, 22:40   #7  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by poisondeathray View Post
Depends on what you want to do with it, and/ or how it's going to be viewed

If you're keeping it as limited range video, then definitely bring the "superbrights" down. But just compressing the highlights darkens the image. But maybe that's the look you're going for. Maybe not. Maybe you want to bring midtones up a bit . You have more control in other programs such as resolve or NLE's
Thanks, the look does not matter too much (it is in Slog2) since I will be color grading it in Resolve and I want to keep as much info as possible when it gets imported into that. But if I keep it as limited range video it will have "unused" margins (16*256 steps up for black and 20*256 steps down for white) right?
anton_foy is offline   Reply With Quote
Old 26th September 2020, 22:44   #8  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by anton_foy View Post
Regarding levels, if I do not use it at all I get blown out highlights and the only solution I could come up with was this:
Levels(0, 1, 65280, 0, 235*256, coring=false, dither=false)
That's odd.

I can take a look at things if you provide an out of camera clip compared to your results after processing.

Quote:
Originally Posted by anton_foy View Post
The lens is a Tamron 10-24mm f/3.5-4.5. Not so sharp but nice for the wide angles. In this test clip the focus is off tho.
Quite a heavy chromatic aberration at the edges.
Cary Knoop is offline   Reply With Quote
Old 26th September 2020, 23:31   #9  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Cary Knoop View Post
That's odd.

I can take a look at things if you provide an out of camera clip compared to your results after processing.


Quite a heavy chromatic aberration at the edges.
Thanks! I did another test and found out that when I import the frames in Photoshop the highlights are lost / blown out but I found that when I import the processed clip into Davinci Resolve and change levels from "auto" to "full" under "Clip attributes" the highlights are back. So Resolve interprets the clip incorrectly and I have to manually set this on each clip I import. Well that solved it. No more need to use Levels.

Yes it is quite some chromatic aberration on this one but I like the lens in some situations

Here are the clips:
https://we.tl/t-nWFpkdzzCT
anton_foy is offline   Reply With Quote
Old 26th September 2020, 23:35   #10  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by anton_foy View Post
So Resolve interprets the clip incorrectly and I have to manually set this on each clip I import.
Not necessarily.

Resolve loads video levels by placing the visible range between 0.0 and 1.0 float32.
If the clip has WTW, you can pull it in using highlight roll off, as Resolve never clips.

As a matter of fact Resolve interprets your sheep clip as full, not even the transients go out of range even when I interpret the clip under video levels, so I do not understand how you observe any clipping.

Assuming the clip was recorded Rec709 the video is underexposed and the temperature is a bit on the cold side.

The other clip is also full range and interpreted correctly by Resolve. This clip is overexposed, and you have blown out highlights that cannot be recovered.

Check the camera options because for Rec709 videos you should really use video levels.

Last edited by Cary Knoop; 26th September 2020 at 23:55.
Cary Knoop is offline   Reply With Quote
Old 26th September 2020, 23:58   #11  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
@Cary Knoop

Quote:
As a matter of fact Resolve interprets your sheep clip as full, not even the transients go out of range even when I interpret the clip under video levels, so I do not understand how you observe any clipping.
I meant the processed clip not the original ones. But good then I can just pull it back either way then.
anton_foy is offline   Reply With Quote
Old 27th September 2020, 00:37   #12  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by anton_foy View Post
@Cary Knoop


I meant the processed clip not the original ones. But good then I can just pull it back either way then.
Unfortunately, there is really nothing to pull back on either clip.
Cary Knoop is offline   Reply With Quote
Old 27th September 2020, 01:03   #13  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Cary Knoop View Post
Unfortunately, there is really nothing to pull back on either clip.
I think you misunderstood. Did you watch the images I uploaded? In one of them the highlights are more blown out and the other is not as much. So when I switched to levels "full" in Clip Attributes in Resolve I did not have that problem anymore. So that is what I meant by "pull back".
anton_foy is offline   Reply With Quote
Old 27th September 2020, 01:04   #14  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by anton_foy View Post
I think you misunderstood. Did you watch the images I uploaded? In one of them the highlights are more blown out and the other is not as much. So when I switched to levels "full" in Clip Attributes in Resolve I did not have that problem anymore. So that is what I meant by "pull back".
We seem to have a misunderstanding, the sheep clip is underexposed and there are no blown-out highlights while the test clip is overexposed, no processing will be able to recover those.
Cary Knoop is offline   Reply With Quote
Old 27th September 2020, 01:46   #15  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Cary Knoop View Post
We seem to have a misunderstanding, the sheep clip is underexposed and there are no blown-out highlights while the test clip is overexposed, no processing will be able to recover those.
Yes they are underexposed and overexposed, out of focus and not correct white balanced etc. hence "test clips". But I used them not to impress you but for the purpose to demonstrate my problem with "clipped highlight" (the castle clip anyway) that is caused by how Resolve displays the clip depending on if full, video or auto settings on levels. Now it is working and I am happy
anton_foy is offline   Reply With Quote
Old 27th September 2020, 02:24   #16  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
You are missing the point, the point is that the test clip is clipped beyond repair:

https://www.dropbox.com/s/nhb2136xthuymze/clipped.jpg

It is not a full versus video levels issue.
Cary Knoop is offline   Reply With Quote
Old 27th September 2020, 06:06   #17  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Also checked out the clips in Resolve and agree with Cary - the 'test' clip is full range and over-exposed i.e. when brought into Resolve at 'Full' data levels the highlights are clipped - there is no latitude for 'highlight pull-down'.

You could have a go at softening the margins of the clipped patches of sky with a qualifier mask, but I think I'd be more inclined to import the clip at 'Video' levels, darken it with a Layer Node and 'Multiply' composite blend ('opacity' = Key Output Gain around 0.30 to 0.35) and apply a Soft Clip with the Curves Tool (H.S around 39) to bring the clipped highlights just into range. Maybe add some Mid-Tone Detail and adjust Saturation to taste.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 27th September 2020 at 06:48.
WorBry is offline   Reply With Quote
Old 27th September 2020, 10:09   #18  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by Cary Knoop View Post
You are missing the point, the point is that the test clip is clipped beyond repair:

https://www.dropbox.com/s/nhb2136xthuymze/clipped.jpg

It is not a full versus video levels issue.
...once again, I know it is clipped beyond repair, it is white totally in some places in the castle clip BUT that is NOT the point. Look at the first images I uploaded and compare them side by side. Then you will see that one is more blown out the other and that is the same exact frame, that was the POINT of this thread of how to process without clipping even more.
I could use a non blown out highlights to demonstrate the problem but that would not make much sense since there are not enough brights in the image.

http://www.imagebam.com/image/7cf4ca1355130247
http://www.imagebam.com/image/6309cc1355130248
anton_foy is offline   Reply With Quote
Old 27th September 2020, 10:18   #19  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
Quote:
Originally Posted by WorBry View Post
Also checked out the clips in Resolve and agree with Cary - the 'test' clip is full range and over-exposed i.e. when brought into Resolve at 'Full' data levels the highlights are clipped - there is no latitude for 'highlight pull-down'.

You could have a go at softening the margins of the clipped patches of sky with a qualifier mask, but I think I'd be more inclined to import the clip at 'Video' levels, darken it with a Layer Node and 'Multiply' composite blend ('opacity' = Key Output Gain around 0.30 to 0.35) and apply a Soft Clip with the Curves Tool (H.S around 39) to bring the clipped highlights just into range. Maybe add some Mid-Tone Detail and adjust Saturation to taste.
Thanks yes as I explained in my earlier post I am not interested in highlight "pull down" or "roll off". This is just a test clip showing the difference that was bothering me and (see previous or first post for image comparison) between different settings (levels) on the same frame. The solution for me was to remove the levels line in my avs-script and use "full" levels in Resolve and the blown out highlights were no more double blown out.

Poisondeathray
Quote:
It's cut off by the limited range RGB conversion. The Y values are still there , you just don't "see" them in an RGB image
he replied this and that was the answer, I just did not know how to make it visible again until now.

Last edited by anton_foy; 27th September 2020 at 10:29.
anton_foy is offline   Reply With Quote
Old 27th September 2020, 16:03   #20  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
And again, I would update the camera settings to use video levels for Rec709 instead of full levels.
Cary Knoop is offline   Reply With Quote
Reply


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 00:06.


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