Android stores bitmap data in alpha-multiplied form. In other words, the alpha value is not applied when copying data, it is applied all the time.
, , :
redPremultiplied = red * normalizedAlpha
greenPremultiplied = green * normalizedAlpha
bluePremultiplied = blue * normalizedAlpha
alphaPremultiplied = alpha
red = <value between 0 and 255>
green = <value between 0 and 255>
blue = <value between 0 and 255>
alpha = <value between 0 and 255>
normalizedAlpha = alpha / 255
, :
red = redPremultiplied / normalizedAlpha
green = greenPremultiplied / normalizedAlpha
blue = bluePremultiplied / normalizedAlpha
alpha = alphaPremultiplied
Alpha = 0! , , Bitmap.copyPixelsToBuffer() Bitmap.copyPixelsFromBuffer() , . Bitmap.getPixels() Bitmap.setPixels(), API , . , un-premultiplying , .