Below are image comparison files students have made working on rgba and some notes about them. Note that most errors have multiple possible causes and most causes can manifest with multiple possible symptoms. If you find an error not represented here or a solution to an error represented her that is not discussed here, please let me know so I can update this page.


This image is characterized by every pixel having the foremost triangle’s hue. For example, the pixel at (53,72) should be #74c0e9 but is #00bfbf instead. The most common cause for this is failing to use the right destination RGB, setting the new RGB based on the source RGB and source and destination A, but not the destination RGB. It can also happen if the two RGBs are in different spaces (i.e. 0–255 for the source and 0–1 for the destination).


This image is characterized by overlapping pixels being too dark. For example, the pixel at (53,72) should be #74c0e9 but is #4e8fe8 instead.

There are several variations of this. Two we’ve diagnosed are

  • Typo (incorrect parentheses in the computation)

  • Incorrect handling of sRGB and alpha. Alpha composition should happen entirely in linear color space, not sRGB, so if you are reading the destination color from an image (as opposed to keeping a linear-color-space raster in memory until the end of the rendering) then you need to convert that back from sRGB to linear before using it in the alpha compositing equation.


This image is characterized by having the correct RGB everywhere, but having only fully-opaque and fully-transparent pixels, none in between those two extremes. The most common cause is forgetting to set the alpha channel in the image file.


This image will be graded as correct. The strange green bar in the final comparison is caused by the magnification of small rounding errors when alpha is removed by ImageMagick to create the pixel diff comparisons.