开发者

Adding transparency to PNGCanvas images

开发者 https://www.devze.com 2023-01-28 23:30 出处:网络
I\'ve been playing around with PNGCanvas, and the one thing I can\'t figure out is how to add transparency to images. I\'v开发者_运维百科e been trying to vary the alpha channel values, but it only adj

I've been playing around with PNGCanvas, and the one thing I can't figure out is how to add transparency to images. I'v开发者_运维百科e 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消