This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] VapourSynth Levels filter does not work for RGB24 image streams
#4
And here is how it looks if i apply Levels to 16 bit image. min_in=4096, max_in=60160 are correct numbers for 16 bit but it should detect it as RGB48 instead of RGB24
# Imports
import vapoursynth as vs
core = vs.get_core()
# loading source: /Users/shph/Desktop/No name.tif
# color sampling RGB24@16, matrix:709, scantyp: progressive
# luminance scale PC
# resolution: 800x600
# frame rate: 25 fps
# Loading /Users/shph/Desktop/No name.tif using vsImageReader
clip = core.imwri.Read(["/Users/shph/Desktop/No name.tif"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# Color Adjustment
clip = core.std.Levels(clip=clip, min_in=4096, max_in=60160, min_out=4096, max_out=60160)
# adjusting output color from: RGB24 to YUV422P10 for ProResModel (i422)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="709", range_s="full")
# Output
clip.set_output()

Same problem with 32 bit imported image:
# Imports
import vapoursynth as vs
core = vs.get_core()
# loading source: /Users/shph/Desktop/No name 32bit.tif
# color sampling RGB32@32, matrix:709, scantyp: progressive
# luminance scale PC
# resolution: 800x600
# frame rate: 25 fps
# Loading /Users/shph/Desktop/No name 32bit.tif using vsImageReader
clip = core.imwri.Read(["/Users/shph/Desktop/No name 32bit.tif"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# Color Adjustment
clip = core.std.Levels(clip=clip, min_in=268435456, max_in=-352321536, min_out=268435456, max_out=-352321536)
# adjusting output color from: RGB24 to YUV422P10 for ProResModel (i422)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="709", range_s="full")
# Output
clip.set_output()

Also seems it depends of file format:
8 bit JPEG and TIFF image detected by Levels correctly: "min_in=16, max_in=235"
8 bit PNG image detected by Levels incorrectly: "min_in=1048576, max_in=15400960"
Reply


Messages In This Thread
RE: VapourSynth Levels filter does not work for RGB24 image streams - by shijan - 17.10.2020, 06:15

Forum Jump:


Users browsing this thread: 1 Guest(s)