A mask of indices that the shape fills.
available_width = min(image[1] - point[1], shape[1])
if available_width < shape[0]:
raise ArithmeticError("cannot fit shape to image")
available_height = min(image[0] - point[0], shape[1])
if available_height < shape[0]:
raise ArithmeticError("cannot fit shape to image")
// Pick random widths and heights.
After Change
// Pick random widths and heights.
r = shape[0] + random.randint(max(1, available_height)) - 1
c = shape[0] + random.randint(max(1, available_width)) - 1
rectangle = draw_polygon([
point[0],
point[0] + r,
point[0] + r,