(self, name)
return imgBytes.read()
convert name image to bytes in png format
        if name is a string (not an image variable) attempt to load it
        return blank image if image is None
convert name image to bytes in png format
        if name is a string (not an image variable) attempt to load it
        return blank image if image is None
convert name image to bytes in png format if name is a string ( not an image variable ) attempt to load it return blank image if image is None
def img_to_png(self, name):
        '''
        convert name image to bytes in png format
        if name is a string (not an image variable) attempt to load it
        return blank image if image is None
        '''
        if isinstance(name, str):
            name = self.load_image(name)
        if name is None:
            name = self.make_blank_image()
        imgBytes = io.BytesIO()
        name.save(imgBytes, format='PNG')
        imgBytes.seek(0)
        return imgBytes.read()
def img_to_png ( self , name ) : if isinstance ( name , str ) : name = self . load_image ( name ) if name is None : name = self . make_blank_image ( ) imgBytes = io . BytesIO ( ) name . save ( imgBytes , format = 'PNG' ) imgBytes . seek ( 0 ) return imgBytes . read ( )