def __init__(self, width, height, data):
        assert len(data) == (width * height)
        bytes = []
        for row in xrange(height):
            val = 0
            offset = row * width
            for col in xrange(width):
                d = col % 8
                if col > 0 and d == 0:
                    bytes.append(chr(val))
                    val = 0
                v = data[offset + col]
                val |= v << (7 - d)
            bytes.append(chr(val))
        self.width = width
        self.height = height
        self.data = ''.join(bytes)
Initialize an XBM image.
dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/docking/xbms.py/XBM.__init__