The reason you are not seeing the text correctly on the RGBA is that you did not define the colors correctly. The text()
method's parameter fill
expects an integer-valued tuple, so (0,0,0,1)
would result in a nearly transparent color (0=fully transparent, 255=fully opaque). Try again with
font_color_bgra = (0,0,0,255) # black
This should resolve your issue.
On the pure RGB image the alpha-component is not considered, thus you do not see the same error on the zebra background image.