在Python中水平翻转图像时出错

2024-03-29 09:56:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要水平翻转图片,不使用反转函数,我以为我是对的,但我得到的错误是

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    Flip("bm.gif","bm.ppm")
  File "C:\Users\....ImageProcessingSKLT.py", line 133, in Flip
    pic1 = graphics.getPixel(x,y)
AttributeError: 'module' object has no attribute 'getPixel'

我的密码是

^{pr2}$

这个错误是什么意思?我该怎么解决呢?在


Tags: 函数inmost错误line水平图片call
2条回答
        pic1 = graphics.getPixel(x,y)
        pic2 = graphics.setPixel(X-x,y)

可能应该是:

^{pr2}$

解释器抱怨在模块graphics中找不到getPixel函数;它是img.getPixel,而不是{}。在

相关问题 更多 >