0

I know you can use PIL to open a file(say jpg) and process it. I am also using pygame.camera to obtain a snapshot of the camera

say I have something like

cam=pygame.camera.Camera("/dev/video0",(640,480))
cam.start()
image=cam.get_image()

how can I process this image with PIL? is it even possible?

I tried

img_gray=ImageOps.grayscale(image)

but I got an error saying "Invalid argument specifying new format to convert to" (return image.convert("L")

is there a way to do something like this??

furas
  • 134,197
  • 12
  • 106
  • 148
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
  • always put FULL error message (Traceback) in QUESTION. – furas Jan 31 '17 at 18:31
  • PyGame `image` is PyGame's `Surface`, `PIL` may expect PIL's Image object. Both should have functions `to_string`, `from_string`. – furas Jan 31 '17 at 18:34

0 Answers0