Search code examples
pythonpngalpha-transparency

Adding transparency to PNGCanvas images


I've been playing around with PNGCanvas, and the one thing I can't figure out is how to add transparency to images. I've been trying to vary the alpha channel values, but it only adjusts the intensity of the color. Am I barking up the wrong tree using this library, or is there hope?


Solution

  • You're barking up the wrong tree. Here's a quote from PNGCanvas.dump:

    # 8-bit image represented as RGB tuples
    # simple transparency, alpha is pure white
    

    Looking further through its code, when you provide alpha it's just blending it with the background, and the final background is just white.