PDA

View Full Version : Overlay function BUG ?


AnnaFan777
4th May 2008, 05:16
######################################################
#
# When using Overlay , the output seems a bit greenish.
#
# When I use Layer instead, there's no such problem.
#
############ TEST OVERLAY ############################

white = BlankClip(length=1, width=640, height=40, fps=25, color=$FFFFFF )

white = converttoRGB32(white)

white = Overlay( white, white, mask=white)
o1 = white
white = Overlay( white, white, mask=white)
o2 = white
white = Overlay( white, white, mask=white)
o3 = white
white = Overlay( white, white, mask=white)
o4 = white
white = Overlay( white, white, mask=white)
o5 = white
white = Overlay( white, white, mask=white)
o6 = white
white = Overlay( white, white, mask=white)
o7 = white
white = Overlay( white, white, mask=white)
o8 = white
white = Overlay( white, white, mask=white)
o9 = white
white = Overlay( white, white, mask=white)
o10 = white
white = Overlay( white, white, mask=white)
o11 = white
white = Overlay( white, white, mask=white)
o12 = white

return StackVertical(o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12)

########################################################

please see the output pic:

http://dabadee.hypermart.net/test/overlaytest.jpg

thank you.

nonsens112
4th May 2008, 09:40
It is seemingly due to Overlay's internal RGB -> YUV -> RGB conversion with coring (0...255 -> 16...235) enabled by default.
Being cured by adding pc_range=true into Overlay().

Similar effect can be found in Levels(), use coring=false there.

AnnaFan777
4th May 2008, 14:12
Thank you, it solves the issue, I'd think that if the input
is in RGB, overlay should use pcrange is true as default, unless user want their videos to be a bit greenish...
.

AnnaFan777
4th May 2008, 15:58
It is seemingly due to Overlay's internal RGB -> YUV -> RGB conversion with coring (0...255 -> 16...235) enabled by default.
Being cured by adding pc_range=true into Overlay().

Similar effect can be found in Levels(), use coring=false there.


I check the pixel value after the 10th conversion,
the R,B drop to 220, BUT G stays at 255, is that a bug rather
than conversion loss ?

Thats just way too much for conversion loss, isn't it?

.

Wilbert
4th May 2008, 16:43
There is a bug in Overlay's RGB<->YCbCr (internally i converts everything to YCbCr 4:4:4) conversion, which can only be avoided if all clip are in YCbCr. It will be fixed in the next release.