为 PNGCanvas 图像添加透明度

发布于 2024-10-06 00:39:39 字数 173 浏览 0 评论 0原文

我一直在玩PNGCanvas,但有一件事我不明白是如何为图像添加透明度。我一直在尝试改变 Alpha 通道值,但它只能调整颜色的强度。我是否使用这个库找错了树,或者还有希望吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅此而已 2024-10-13 00:39:39

你找错了树。以下是 PNGCanvas.dump 的引用:

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

进一步查看其代码,当您提供 alpha 时,它只是将其与背景混合,最终的背景只是白色。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文