Online Pillow Compiler

Code, compile, and run Pillow programs online

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
AI Prompt