def generate_bounds_for_fragments(x_size, y_size, move_size, image_dimension):
    """
    Generate bounds for fragments, for an image of arbitrary size

    Inputs:
        x_size - width of the image
        y_size - height of the image
        move_size - pixels to move (horizontally and vertically) between each step
    Returns:
        a list of 4-tuples, of the format (x_start, y_start, x_end, y_end)
    """
    bounds = []

    moves_x = (x_size - image_dimension) // move_size
    moves_y = (y_size - image_dimension) // move_size

    for y in range(moves_y):
        for x in range(moves_x):
            y_start = y * move_size
            x_start = x * move_size
            x_end = x_start + image_dimension
            y_end = y_start + image_dimension
            bounds.append((x_start, y_start, x_end, y_end))

    return bounds