<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toPIL(self, **attribs):
 """ Convert canvas to a PIL image """

        import PIL.Image
        bytes = self.convert("png")
        sfile = io.BytesIO(bytes)
        pil = PIL.Image.open(sfile)
        return pil