【发布时间】:2014-08-27 10:47:55
【问题描述】:
谁能帮帮我?
我是 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.
你们能帮帮我吗?谢谢
【问题讨论】:
标签: python jython brightness jes