def crop_to_image_boundary(image, boxes, image_boundary):
    """Crop transformed image to original image boundaries (e.g., remove
    padding).

    Parameters
    ----------
    image : np.ndarray
        Numpy integer array of shape (H, W, C).
    boxes : np.ndarray
        Numpy array of shape (N, 4), where N is the number of boxes.
    image_boundary : np.ndarray or None
        Numpy array of shape (4,). If None, no cropping will be performed.
    """
    if image_boundary is None:
        return image, boxes

    height, width = image.shape[:2]
    xmin, ymin, xmax, ymax = image_boundary.astype("int")
    xmin = max(xmin, 0)
    ymin = max(ymin, 0)
    xmax = min(xmax, width)
    ymax = min(ymax, height)

    cropped_image = image[ymin:ymax, xmin:xmax]
    cropped_boxes = []

    for box in boxes:
        cropped_boxes.append(box - [xmin, ymin, xmin, ymin])

    return cropped_image, cropped_boxes