code: def read(self):
          
          stream = BytesIO()
          self.cam.capture(stream, format='png')
          # "Rewind" the stream to the beginning so we can read its content
          stream.seek(0)
          return Image.open(stream)
docs: https://picamera.readthedocs.io/en/release-1.13/recipes1.html#capturing-to-a-pil-image