Online Pillow Compiler

Code, compile, and run Pillow programs online. Write your code in this editor and click the "Run" button to execute it.

from PIL import Image, ImageDraw

# Create a new image with RGB mode
image ="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