【问题标题】:Convert an image to RGBA mode with python使用python将图像转换为RGBA模式
【发布时间】:2010-01-01 04:11:33
【问题描述】:

我尝试使用Using PIL to make all white pixels transparent 中列出的代码将一些 .ico 文件转换为具有透明背景的 .png 图像。

它不适用于所有 .ico 图像,有时它只是输出黑色背景的图像。

示例 .ico 文件可以位于 here

【问题讨论】:

    标签: python image python-imaging-library transparent


    【解决方案1】:

    我在您放在那里的所有图标上都尝试了该脚本。它工作得很好。有时它代表黑色背景的透明度。确保背景完全透明。在 Photoshop 中打开它。 编辑:确保您的图标具有 Alpha 通道。

    【讨论】:

      猜你喜欢
      • 2021-12-17
      • 1970-01-01
      • 2017-07-19
      • 1970-01-01
      • 2021-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多