The calculation doesn't produce the same results. Keep just the change to divide alpha by 255 instead of 256, for slightly better accuracy
The calculation doesn't produce the same results. Keep just the change to divide alpha by 255 instead of 256, for slightly better accuracy