Esempio n. 1
0
def to_pixbuf(img, colorspace=gdk.COLORSPACE_RGB, bits_per_sample=8):
    """
    Convert NxMx3 matrix to GDK pixbuf.
    """
    return gdk.pixbuf_new_from_array(np.asarray(img, dtype=np.uint8), 
                                     colorspace, bits_per_sample)
Esempio n. 2
0
 def pixbuf(self):
     """The restored pixbuf after the transform (if any)."""
     return gdk.pixbuf_new_from_array(array(dstack(self.target) * 256.0, dtype=uint8), self.space, self.bits)
Esempio n. 3
0
def to_pixbuf(img, colorspace=gdk.COLORSPACE_RGB, bits_per_sample=8):
    """
    Convert NxMx3 matrix to GDK pixbuf.
    """
    return gdk.pixbuf_new_from_array(np.asarray(img, dtype=np.uint8),
                                     colorspace, bits_per_sample)
Esempio n. 4
0
 def pixbuf(self):
     """The restored pixbuf after the transform (if any)."""
     return gdk.pixbuf_new_from_array(
             array(dstack(self.target)*256.0, dtype=uint8),
             self.space, self.bits)