Online Pillow Compiler

Use the Pillow library to create a simple image

Python
from PIL import Image, ImageDraw

# Create a new image with RGB mode
image = Image.new("RGB", (200, 200), "blue")

# Draw a red rectangle on the image
draw = ImageDraw.Draw(image)
draw.rectangle([(50, 50), (150, 150)], fill="red")

# Show the image
image
Click Run or press shift + ENTER to run code.