diff --git a/test_data/create_test_data.py b/test_data/create_test_data.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f5f70f579499043da8db316fc4751385d9ab0a67 100644 --- a/test_data/create_test_data.py +++ b/test_data/create_test_data.py @@ -0,0 +1,43 @@ +from PIL import Image, ImageDraw + +def generate_test_image(width, height, file_path): + # Create an empty white image + image = Image.new(mode = "RGB", size = (width, height), color=(255,255,255)) + + # Save the image as a PNG file + image.save(file_path) + +# Example usage +width = 1000 # Specify the width of the image in pixels +height = 1000 # Specify the height of the image in pixels +file_path = 'testimage.png' # Specify the file path for saving the image + +# Generate and save the black and white image +generate_test_image(width, height, file_path) + +def generate_white_image_with_squares(width, height, square_size, square_locations): + # Create a white image with objects of specified size and x, y location + image = Image.new('RGB', (width, height), color=(255, 255, 255)) + + # Create a draw object + draw = ImageDraw.Draw(image) + + # Draw black squares + for location in square_locations: + x, y = location + square = (x, y, x + square_size, y + square_size) + draw.rectangle(square, fill=(0, 0, 0)) + + return image + +# Example usage +width = 1000 # Specify the width of the image in pixels +height = 1000 # Specify the height of the image in pixels +square_size = 50 # Specify the size of the black squares in pixels +square_locations = [(500, 500), (150, 150), (250, 250), (750, 750)] # Specify the x, y locations of the black squares + +# Generate the white image with black squares +image = generate_white_image_with_squares(width, height, square_size, square_locations) + +# Save the image +image.save('white_image_with_squares.png') \ No newline at end of file diff --git a/test_data/white_image_with_squares.png b/test_data/white_image_with_squares.png new file mode 100644 index 0000000000000000000000000000000000000000..f2caf78a8adb2896d8a8a125dadd167c65de4add Binary files /dev/null and b/test_data/white_image_with_squares.png differ