Deleted line should not change value of alpha. This line, with lossless precision, can be written as: alpha = alpha*mask*opacity + alpha*(1 - mask*opacity) and simplified to: alpha = alpha * 1 but use of fixed point math introduces loss of precision.