strip = strip.reshape(W, 3, 8)
bytes = (strip * 2 ** np.arange(8)[(np.newaxis), (np.newaxis), :]).sum(axis=2)
byteString = bytes.astype(np.ubyte).tostring()
Billing aliens via POS printer and image print