code: def from_image(cls, image, filename):
          
  
          source = Image.open(BytesIO(image))
          source = source.convert('1')
          width = int(math.ceil(source.size[0] / 8.0))
  
          data = []
          for line in _chunked(list(source.getdata()), source.size[0]):
              row = ''.join(['0' if p else '1' for p in line])
              row = row.ljust(width * 8, '0')
              data.append(row)
          data = GRFData(width, bin=''.join(data))
  
          return cls(filename, data)
docs: Filename is 1-8 alphanumeric characters to identify the GRF in ZPL.