p5js

Generates interactive p5.js sketches and generative art exported as HTML, PNG, GIF, MP4, or SVG.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/AvaTar-ArTs/.Agent-skills --skill p5js-avatar-arts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: p5js
Source: https://github.com/AvaTar-ArTs/.Agent-skills/tree/main/skills/creative/p5js
Command: npx skills add https://github.com/AvaTar-ArTs/.Agent-skills --skill p5js-avatar-arts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires puppeteer, and includes scripts (resource) and references (resource) components.

What problem does it solve? Creating browser-based generative art, interactive visualizations, and canvas animations requires deep knowledge of p5.js APIs, color theory, animation timing, and export pipelines. This Skill provides a complete production pipeline from creative concept to exported output, eliminating the trial-and-error of writing creative coding projects from scratch. ## Core Features & Use Cases - Seven Creation Modes: Generative art, data visualization, interactive experiences, animation/motion graphics, 3D WebGL scenes, image processing, and audio-reactive visuals. - Full Export Pipeline: Output as self-contained HTML, PNG stills, GIF loops, MP4 video via Puppeteer and ffmpeg, or SVG vector files for print. - Deep Reference Library: Ten reference documents covering noise fields, particle systems, GLSL shaders, easing functions, color palettes, typography, and performance optimization. - Use Case: Ask for a flow-field particle animation with a custom warm palette, and receive a single HTML file with seeded randomness, keyboard export shortcuts, and layered offscreen-buffer composition that runs in any browser. ## Quick Start Use the p5js skill to create a generative art sketch of flowing particles with a sunset color palette, exported as a self-contained HTML file.

Frequently Asked Questions about p5js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create generative art with p5.js?

Define a creative concept first, then write a single HTML file with p5.js from CDN, using randomSeed() and noiseSeed() for reproducibility. Structure code with setup() and draw() functions, use HSB color mode, and layer offscreen buffers with createGraphics() for depth.

How to export p5.js animation as MP4 video?

Capture frames headlessly with Puppeteer using noLoop() and window._p5Ready for deterministic frame control, then encode with ffmpeg using libx264. The render.sh script automates the full HTML-to-MP4 pipeline.

Should I use p5.js 1.x or 2.x for my sketch?

Use p5.js 1.11.3 by default for stability and broad library compatibility. Choose 2.x only when you need async setup(), OKLCH color modes, splineVertex(), shader .modify() API, or the p5.brush natural media library.

Why is my p5.js sketch running slowly?

The Friendly Error System adds up to 10x overhead, so set p5.disableFriendlyErrors = true before setup(). Also call pixelDensity(1), use Math.* functions instead of p5 wrappers in hot loops, and batch particles with beginShape(POINTS) or pixel buffers.

Can p5.js export vector SVG files for print?

Yes, using the p5.js-svg library with createCanvas(w, h, SVG) and save('output.svg'). It requires p5.js 1.x and only supports vector operations, so pixel manipulation, blend modes, and filters are unavailable.

How do I make p5.js sketches reproducible with seeds?

Call randomSeed(seed) and noiseSeed(seed) in setup() so all random() and noise() calls become deterministic. Never use Math.random() for visual elements, and expose the seed as a configurable parameter for variation exploration.