有谁可以帮我离开这里吗?
我是 Jython/Python 的新手(一般编码),我目前正在使用这个程序中包含的名为 JES 的库,它允许我轻松更改图像等。
因此,我尝试通过使用 2 个输入(图片和数量)来更改此图像的亮度。
def change(picture, amount):
for px in getPixels(picture):
color = getColor(px)
alter = makeColor(color * amount)
setColor(px, alter)
我尝试了许多其他方法,但它们似乎不起作用。顺便说一句,图片输入已经分配了一个图像。
我通过键入 change(picture, 0.5) 在终端中运行程序,这应该会使图像变亮 50%,但我不断收到此错误:
>>> change(picture, 0.5)
The error was: 'instance' and 'float'
Inappropriate argument type.
An attempt was made to call a function with a parameter of an invalid type. This means that you did something such as trying to pass a string to a method that is expecting an integer.
你们能帮帮我吗?谢谢