2024-05-20 12:27:56 发布
网友
和标题一模一样。我拍摄模式“1”的单波段图像,然后用
image = Image.open("picture.tif")
然后我试着用
然后每当我用
print(image.mode)
我知道它还是“1”。我甚至试过用“L”(另一种单波段图像模式)来做这个,但仍然没有成功。不管我做什么,它都不会改变。搜索网页似乎只显示了从“RGBA”到“1”的转换,但我还没有找到任何关于其他方法的信息。有没有办法(即使在Python之外)将1位深的图像转换为RGBA?在
帮忙吗?在
image.convert不更改图像的模式,它返回具有新模式的新图像。在
image.convert
image = image.convert("RGBA")
来自the documentation:
Unless otherwise stated, all methods return a new instance of the Image class, holding the resulting image.
image.convert
不更改图像的模式,它返回具有新模式的新图像。在来自the documentation:
相关问题 更多 >
编程相关推荐