def from_file(self, filename, translate=False): """Load graphic from an image file.""" if filename[-4:].lower() == '.lmp': self.data = util.readfile(filename) else: im = Image.open(filename) self.from_Image(im, translate)
def from_file(self, source): """Load data from a file. Source may be a path name string or a file-like object (with a `write` method).""" self.data = util.readfile(source)