talira

A friendly tool for learning to code and make art

open sourceLGPL-2.1free

p5.js is a free and open source JavaScript library for creative coding: drawing, animation, interactive sketches, audio-visual and experimental work in the browser, based on the core principles of Processing. Sketches can be written straight away in the p5.js Web Editor in a browser, or by loading the library file in any web page. It has expansive reference documentation with visual examples in many languages, tutorials, WebGL support and a catalogue of community-made add-on libraries, with sound in the separate p5.sound.js library. The project is stewarded by the Processing Foundation, and its leads have said p5.js will not add any new features except those that increase access.

Problems it solves

  • I want to learn to code by making visual art and animations
  • draw shapes, colours and animations in the browser with a few lines of JavaScript
  • teach a beginner coding class where students see their results right away
  • make an interactive generative art sketch that reacts to the mouse and keyboard
  • start sketching with code in my browser without installing anything
  • create audio-reactive visuals for a web page
  • build a 3D sketch with WebGL without learning a full 3D engine
  • port my Processing sketches to run on the web
  • an accessible creative coding library with examples and docs in my own language

Features

  • 2D drawing on HTML canvas: shapes, colour, images, text
  • animation loop with setup() and draw()
  • mouse, keyboard and touch interaction
  • WebGL mode for 3D
  • online p5.js Web Editor to write and share sketches
  • reference with visual examples, translated into several languages
  • community-made add-on libraries
  • sound through the separate p5.sound.js library
  • available as a single file, from a CDN or from npm

Limitations

  • Sound support is a separate library (p5.sound.js), not part of p5.js itself1

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what p5.js does.

  1. Processing A flexible software sketchbook and a language for learning how to code
  2. three.js JavaScript 3D library
  3. openFrameworks Open source C++ toolkit for creative coding
  4. Fabric.js A JavaScript HTML5 canvas library with an interactive object model and SVG parser

Compare p5.js with the top 3