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
Code:
# 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:
Code:
# 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"