Skip to content

Commit

Permalink
fix(comparison): update gamma fix (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravencentric authored Jan 20, 2024
1 parent 8570189 commit 0b9fbb6
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions docs/tutorials/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Make sure to comment (add `##` to the beginning of the line) and uncomment lines

```py
## Dependencies: Allows vspreview to run (required; do not remove)
import vstools
import vapoursynth as vs
from vapoursynth import core
from awsmfunc import FrameInfo
Expand Down Expand Up @@ -300,10 +301,15 @@ clip3 = core.resize.Bicubic(clip3, format=vs.YUV444P16, range=1)
Adjusts the gamma level of the video. *This should only be used to fix the QuickTime gamma bug or similar where one source will appear much brighter than the rest.*

```py
## Gamma: Fixes gamma bug (i.e. one source is significantly brighter than the others) [16-bit required]
clip1 = core.std.Levels(clip1, gamma=0.88, min_in=4096, max_in=60160, min_out=4096, max_out=60160, planes=0)
clip2 = core.std.Levels(clip2, gamma=0.88, min_in=4096, max_in=60160, min_out=4096, max_out=60160, planes=0)
clip3 = core.std.Levels(clip3, gamma=0.88, min_in=4096, max_in=60160, min_out=4096, max_out=60160, planes=0)
# Convert the clips to 32bit [Required for gamma fix]
clip1 = vstools.depth(clip1, 32)
clip2 = vstools.depth(clip2, 32)
clip3 = vstools.depth(clip3, 32)

## Gamma: Fixes gamma bug (i.e. one source is significantly brighter than the others) [32-bit required]
clip1 = core.std.Levels(clip1, gamma=0.88, planes=0)
clip2 = core.std.Levels(clip2, gamma=0.88, planes=0)
clip3 = core.std.Levels(clip3, gamma=0.88, planes=0)
```

#### Matrix
Expand Down Expand Up @@ -359,6 +365,7 @@ Make sure to comment (add `##` to the beginning of the line) and uncomment lines

```py
## Dependencies: Allows vspreview to run (required; do not remove)
import vstools
import vapoursynth as vs
from vapoursynth import core
from awsmfunc import FrameInfo
Expand Down Expand Up @@ -444,10 +451,15 @@ clip3 = core.resize.Bicubic(clip3, format=vs.YUV444P16)
##clip2 = core.resize.Bicubic(clip2, format=vs.YUV444P16, range=0)
##clip3 = core.resize.Bicubic(clip3, format=vs.YUV444P16, range=1)

## Gamma: Fixes gamma bug (i.e. one source is significantly brighter than the others) [16-bit required]
##clip1 = core.std.Levels(clip1, gamma=0.88, min_in=4096, max_in=60160, min_out=4096, max_out=60160, planes=0)
##clip2 = core.std.Levels(clip2, gamma=0.88, min_in=4096, max_in=60160, min_out=4096, max_out=60160, planes=0)
##clip3 = core.std.Levels(clip3, gamma=0.88, min_in=4096, max_in=60160, min_out=4096, max_out=60160, planes=0)
# Convert the clips to 32bit [Required for gamma fix]
##clip1 = vstools.depth(clip1, 32)
##clip2 = vstools.depth(clip2, 32)
##clip3 = vstools.depth(clip3, 32)

## Gamma: Fixes gamma bug (i.e. one source is significantly brighter than the others) [32-bit required]
##clip1 = core.std.Levels(clip1, gamma=0.88, planes=0)
##clip2 = core.std.Levels(clip2, gamma=0.88, planes=0)
##clip3 = core.std.Levels(clip3, gamma=0.88, planes=0)

## Matrix: Repairs sources with incorrect/missing metadata; typically used for 4K SDR and upscaled/downscaled content (colors will be off, particularly reds, greens, and blues)
##clip1 = core.std.SetFrameProp(clip1, prop="_Matrix", intval=1)
Expand Down

0 comments on commit 0b9fbb6

Please sign in to comment.