When the data type is Byte, instead of reading a first time the red band to deduce the value of the alpha component of the output image, read the RGB bands first.
62dbfea