def _make_rgba(data_in):
    max_val = _max_for_dtype(data_in.dtype)
    if ((data_in.ndim == 3) and (data_in.shape[(- 1)] == 1)):
        data_in = data_in.squeeze()
    if (data_in.ndim == 2):
        out = np.stack(([data_in] * 4), axis=2)
        out[:, :, 3] = max_val
    elif (data_in.shape[(- 1)] == 3):
        out = np.concatenate((data_in, (np.ones((*data_in.shape[:2], 1)) * max_val)), axis=2)
    else:
        out = data_in
    return np.round(((out.astype(np.float) * 255) / max_val)).astype(np.uint8)
def _make_rgba(data_in):
    max_val = _max_for_dtype(data_in.dtype)
    if ((data_in.ndim == 3) and (data_in.shape[(- 1)] == 1)):
        data_in = data_in.squeeze()
    if (data_in.ndim == 2):
        out = np.stack(([data_in] * 4), axis=2)
        out[:, :, 3] = max_val
    elif (data_in.shape[(- 1)] == 3):
        out = np.concatenate((data_in, (np.ones((*data_in.shape[:2], 1)) * max_val)), axis=2)
    else:
        out = data_in
    return np.round(((out.astype(np.float) * 255) / max_val)).astype(np.uint8)