pangxia75 发表于 2017-4-25 09:55:21

python 图形处理pil

  1:为了识别验证码,首先必须学习下python的图形处理

import Image
im = Image.open("F:\\captcha.jpg")
print im.mode, im.size, im.format
  结果:
  RGB (250, 40) JPEG

rgb是颜色的第二个是像素第三个是格式
  im.show是看不到图片的,不知道为什么?看网上的解决是:

Here is a quick workaround:
Edit C:\Python26\lib\site-packages\PIL\ImageShow.py, and around line 99, replace with the following line:
return "start /wait %s && PING 127.0.0.1 -n 5 > NUL && del /f %s" % (file, file)
  但是还是没用,可能我的python版本不是2.6的。
  现在可以成功了,im.show()可以用
页: [1]
查看完整版本: python 图形处理pil