diff --git a/xpra/codecs/webp/encoder.pyx b/xpra/codecs/webp/encoder.pyx index 8768b05c94..6486b6f126 100644 --- a/xpra/codecs/webp/encoder.pyx +++ b/xpra/codecs/webp/encoder.pyx @@ -398,7 +398,10 @@ def encode(image, int quality=50, int speed=50, supports_alpha=False, content_ty pixels = image.get_pixels() cdef int threshold_delta = -int(content_type=="text")*20 cdef int alpha_int = int(supports_alpha and pixel_format.find("A")>=0) - cdef int use_argb = int(quality>=(SUBSAMPLING_THRESHOLD+threshold_delta)) + #we can only use YUV420P subsampling if we are 100% certain + #that the RGB pixel data contains a valid alpha component + #because WebPPictureARGBToYUVA will set the alpha channel if it finds ANY value + cdef int use_argb = int(quality>=(SUBSAMPLING_THRESHOLD+threshold_delta)) or pixel_format.find("A")<0 cdef WebPConfig config cdef WebPPreset preset = DEFAULT_PRESET