Thanks, it works very well !
And improves a lot 8bit encodes by eliminate banding.
But I think the weight of encoded file is 3 times louder than the same encode in 10bit. I only encoded patterns, so I'm note sure.
I used your first call, because my png is 16bit.
And to encode in 8bit, I only change output depth and mode :
Code:
ImageSource("input.png")
Dither_Convert_RGB_TO_YUV(output="YV24", lsb=True)
f3kdb(Y=0, Cb=0, Cr=0, grainY=0, grainC=0, input_depth=16, input_mode=1, output_depth=8, output_mode=0)