from PIL import Image
import matplotlib.pyplot as plt
# Load the uploaded image
image_path = "/mnt/data/file-Q8DjRukHZtsftmmGBgjUSG"
img = Image.open(image_path)
# Crop the 20th variant from the image (5th row, 5th column)
# Each cell is roughly equal-sized, so we calculate the approximate box
img_width, img_height = img.size
cols, rows = 5, 5
cell_width = img_width // cols
cell_height = img_height // rows
# Coordinates for the 20th variant (row 4, col 5)
col_index = 4
row_index = 3
left = col_index * cell_width
upper = row_index * cell_height
right = left + cell_width
lower = upper + cell_height
cropped_img = img.crop((left, upper, right, lower))
# Show the cropped image
plt.imshow(cropped_img)
plt.axis('off')
plt.title("Variant 20")
plt.show()