Canvas Design Skill
This skill enables the creation of generative art, patterns, and abstract compositions using Python.
Core Capabilities
- Generative Art: Use algorithms to create unique visuals (fractals, noise, cellular automata).
- Pattern Generation: Create seamless tiles, geometric designs, and textures.
- Image Manipulation: Apply filters, blend modes, and transformations.
- Drawing Primitives: Render shapes, lines, and text using vector commands.
Dependencies
Pillow (pip install Pillow) - Core image manipulation.
numpy (pip install numpy) - Mathematical operations for generative art.
matplotlib (pip install matplotlib) - Plotting complex forms.
Workflow Examples
1. Simple Geometric Composition (Pillow)
from PIL import Image, ImageDraw
import random
width, height = 800, 600
img = Image.new('RGB', (width, height), 'white')
draw = ImageDraw.Draw(img)
# Draw random circles
for _ in range(50):
x = random.randint(0, width)
y = random.randint(0, height)
r = random.randint(10, 50)
color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
draw.ellipse([x-r, y-r, x+r, y+r], fill=color, outline='black')
img.save('geometric_art.png')
2. Mandelbrot Fractal (NumPy + Matplotlib)
import numpy as np
import matplotlib.pyplot as plt
def mandelbrot(h, w, max_iter=20):
y, x = np.ogrid[-1.4:1.4:h*1j, -2:0.8:w*1j]
c = x + y*1j
z = c
divtime = max_iter + np.zeros(z.shape, dtype=int)
for i in range(max_iter):
z = z**2 + c
diverge = z*np.conj(z) > 2**2
div_now = diverge & (divtime == max_iter)
divtime[div_now] = i
z[diverge] = 2
return divtime
plt.figure(figsize=(10, 10))
plt.imshow(mandelbrot(800, 800, 50), cmap='magma')
plt.axis('off')
plt.savefig('mandelbrot.png', bbox_inches='tight', pad_inches=0)
Best Practices
- Resolution: Default to reasonable sizes like 800x600 or 1024x1024 for quick generation.
- Vector vs Raster: Use
matplotlib for complex curves/plots, Pillow for pixel manipulation.
- Performance: Avoid extremely high iterations or resolution in Python loops.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: canvas-design-53description: Create programmatic digital art using Python libraries like Pillow (PIL), NumPy, and Matplotlib. Generate images, fractals, patterns, and abstract compositions. Use when this capability is needed.4---56# Canvas Design Skill78This skill enables the creation of generative art, patterns, and abstract compositions using Python.910## Core Capabilities11121. **Generative Art**: Use algorithms to create unique visuals (fractals, noise, cellular automata).132. **Pattern Generation**: Create seamless tiles, geometric designs, and textures.143. **Image Manipulation**: Apply filters, blend modes, and transformations.154. **Drawing Primitives**: Render shapes, lines, and text using vector commands.1617## Dependencies1819* `Pillow` (pip install Pillow) - Core image manipulation.20* `numpy` (pip install numpy) - Mathematical operations for generative art.21* `matplotlib` (pip install matplotlib) - Plotting complex forms.2223## Workflow Examples2425### 1. Simple Geometric Composition (Pillow)2627```python28from PIL import Image, ImageDraw29import random3031width, height = 800, 60032img = Image.new('RGB', (width, height), 'white')33draw = ImageDraw.Draw(img)3435# Draw random circles36for _ in range(50):37 x = random.randint(0, width)38 y = random.randint(0, height)39 r = random.randint(10, 50)40 color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))41 draw.ellipse([x-r, y-r, x+r, y+r], fill=color, outline='black')4243img.save('geometric_art.png')44```4546### 2. Mandelbrot Fractal (NumPy + Matplotlib)4748```python49import numpy as np50import matplotlib.pyplot as plt5152def mandelbrot(h, w, max_iter=20):53 y, x = np.ogrid[-1.4:1.4:h*1j, -2:0.8:w*1j]54 c = x + y*1j55 z = c56 divtime = max_iter + np.zeros(z.shape, dtype=int)5758 for i in range(max_iter):59 z = z**2 + c60 diverge = z*np.conj(z) > 2**2 61 div_now = diverge & (divtime == max_iter) 62 divtime[div_now] = i 63 z[diverge] = 2 6465 return divtime6667plt.figure(figsize=(10, 10))68plt.imshow(mandelbrot(800, 800, 50), cmap='magma')69plt.axis('off')70plt.savefig('mandelbrot.png', bbox_inches='tight', pad_inches=0)71```7273## Best Practices7475* **Resolution**: Default to reasonable sizes like 800x600 or 1024x1024 for quick generation.76* **Vector vs Raster**: Use `matplotlib` for complex curves/plots, `Pillow` for pixel manipulation.77* **Performance**: Avoid extremely high iterations or resolution in Python loops.7879---80> Converted and distributed by [TomeVault](https://tomevault.io/claim/anycowork) — claim your Tome and manage your conversions.81<!-- tomevault:4.0:skill_md:2026-04-11 -->