I've been trying to create my own 2d renderer (for learning purposes) and I'm trying to implement alpha compositing. The formula I'm using is very trivial, which is `color = alpha * src + (1 - alpha) * dest`.
Everything seemed to be going and looking well until I started comparing it to existing 2d canvas implementations. I've tested my canvas against OpenGL, the JS canvas, and a BufferedImage in Java, and they have all been getting slightly different results to the formula I use.
For example, let's say I have a background with a red value of 1, and …