Add Image.space().

This commit is contained in:
Andrey Golovizin 2014-08-15 14:21:38 +02:00
parent 5f7e6abcb9
commit 50b40458bc

View file

@ -66,6 +66,11 @@ class Image(object):
y = self.y + ystart
return Image(self.data[key], x, y)
def space(self, x, y, width, height):
data = np.zeros((height, width, self.shape[2]), dtype=self.data.dtype)
data.fill(255)
return Image(data, x, y)
def _repr_png_(self):
buf = BytesIO()
imsave(buf, self.data)