p5js

Generates interactive and generative visual art as self-contained p5.js HTML sketches.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/xu1713/openhorse --skill p5js-xu1713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: p5js
Source: https://github.com/xu1713/openhorse/tree/main/openhorse/openhorse/skills/creative/p5js
Command: npx skills add https://github.com/xu1713/openhorse --skill p5js-xu1713

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Creating browser-based generative art, interactive visualizations, and motion graphics requires deep knowledge of canvas rendering, noise algorithms, particle systems, shaders, and export pipelines. This Skill provides a complete production workflow that turns text prompts into polished, self-contained p5.js HTML files without manual boilerplate. ## 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 HTML, PNG, GIF, MP4 (via Puppeteer + ffmpeg), or SVG, including deterministic headless frame capture and multi-scene video stitching. - Deep reference library: ten reference documents covering noise, flow fields, particles, easing, springs, color systems, GLSL shaders, typography, and troubleshooting. - Use Case: Ask for "a generative art piece with flowing particles in warm sunset colors, exported as a 10-second MP4" and receive a seeded, reproducible sketch plus the rendered video. ## Quick Start Create a p5.js generative art sketch of an animated flow field with a custom color palette and export it as a PNG.

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?

Describe the visual concept, mood, and color palette you want, and the Skill produces a single self-contained HTML file with inline p5.js code. Open it directly in any browser with no build step or server required.

How do I export a p5.js sketch to MP4 video?

Run bash scripts/render.sh sketch.html output.mp4 with optional duration and fps flags. The pipeline captures frames headlessly with Puppeteer and encodes them to H.264 MP4 using ffmpeg.

Does p5.js support WebGL shaders and 3D scenes?

Yes, p5.js WebGL mode supports 3D primitives, cameras, lighting, materials, and custom GLSL shaders via createShader(). The references/webgl-and-3d.md file covers framebuffers, post-processing, and coordinate system differences from 2D mode.

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) to avoid retina overdraw, and use Math.* functions instead of p5 wrappers inside hot loops.

Can I make p5.js sketches reproducible with seeds?

Yes, call randomSeed() and noiseSeed() with the same seed value in setup() to make all random() and noise() calls deterministic. The Skill enforces seeded randomness on every generative sketch it produces.

What are the limitations of p5.js SVG export?

The p5.js-svg renderer does not support pixel operations, blendMode(), filters, or WebGL, and requires p5.js 1.x rather than 2.x. It works best for line art, geometric patterns, and pen plotter output.