Well, I'm not sure there's a real problem to be fixed here. I believe what's happening is due to how the image is being blended with the background, and if a pixel has a value of (r,g,b,0), the result of the blending will just be the background's value. That is perfectly reasonable behaviour; if alpha=0 the r,g,b values are meaningless.

Prior to the blending, the pixel data is converted uint8 (using trunc(x*255) it looks like), so alpha<1./255 becomes 0. This also seems quite reasonable.

The alternative workarounds (instead of setting a minimum alpha) that come to mind are:
- set the r,g,b values in `data` to 0 where alpha<1./255
- implement a custom comparison where differences in the r,g,b values are ignored if alpha<1./255 on both sides of the comparison

Both those alternatives would (I believe) require more code.