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
I'm not totally sure atm. how to handle 32bit Tiff with Levels properly.

Load a single 32bit TIFF with vsImageReader and applying levels on it returns a black screen the way I assumed it would work.
I assumed that the color space should be RGBS with 32bit precision and thus analog to limiting to 16-235 I used min_in = 16 << (32-8), max_in=235 << (32-8), min_out= 16 << (32-8), max_out = 235 << (32-8).
That gave me a black preview and I'm not sure whether this is due to a limitation of the preview, if I did something wrong or if it's a limitation somewhere else.
So any help is welcome.
# Imports
import vapoursynth as vs
core = vs.get_core()
# source: 'C:/Users/Selur/Desktop/images v2/TIFF 32-bit.tif'
# current color space: RGBS, bit depth: 32, resolution: 640x480, fps: 25, color matrix: 709, yuv luminance scale: full, scanorder: progressive
# Loading C:\Users\Selur\Desktop\images v2\TIFF 32-bit.tif using vsImageReader
clip = core.imwri.Read(["C:/Users/Selur/Desktop/images v2/TIFF 32-bit.tif"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGBS
# 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=18446744073357230080, min_out=268435456, max_out=18446744073357230080)
# Output
-> posted over at doom9s ( to see whether someone there knows how to do it properly.

Quote: Not sure why it detects JPEG as YUV444P8@8 and same time other image formats as RGB24@8. Maybe JPEG is somehow special...
Hybrid takes the color space from MediaInfo which reports:
Format                                   : JPEG
Width                                    : 640 pixels
Height                                   : 480 pixels
Color space                              : YUV
Chroma subsampling                       : 4:4:4
Bit depth                                : 8 bits
Compression mode                         : Lossy
Stream size                              : 44.5 KiB (100%)
ColorSpace_ICC                           : RGB
for your 'JPEG 8-bit HQ enabled.jpg' file.
and for the "PNG 8-bit":
Format                                   : PNG
Format/Info                              : Portable Network Graphic
Format_Compression                       : Deflate
Width                                    : 640 pixels
Height                                   : 480 pixels
Color space                              : RGB
Bit depth                                : 8 bits

Cu Selur
As i remember in Vapoursynth FAQ about a Levels it was a notice that they work very different in 32 bit depth

In both PhotoLine and Photoshop image editors there is no option to export 32 bit PNG. So i guess it is something very uncommon.
@The_Tinkerer: send you a link to a new dev version via PM for testing,..
Hoping that this properly handles 32bit images.

Cu Selur

Forum Jump:

Users browsing this thread: 1 Guest(s)