def __init__(self, im, x, y):
self.im = img_as_ubyte(im)
self.imrgb = grey2rgb(self.im)
self.w, self.h = im.shape
self.x, self.y = x, y
self.cellw = self.w / x
self.cellh = self.h / y
self._cell_colors()