def decode(data_buffer): """ Decode grey-scale image via JPEG-LS using CharLS implementation. """ data_image = _CharLS.decode(data_buffer) return data_image
def read(fname): """ Read image data from JPEG-LS file. """ with open(fname, "rb") as fo: string_buffer = fo.read() data_buffer = np.fromstring(string_buffer, dtype=np.uint8) data_image = _CharLS.decode(data_buffer) # Done. return data_image
def read(fname): """ Read image data from JPEG-LS file. """ with open(fname, 'rb') as fo: string_buffer = fo.read() data_buffer = np.fromstring(string_buffer, dtype=np.uint8) data_image = _CharLS.decode(data_buffer) # Done. return data_image