The p5-server
command-line tool, and the P5
Server Visual Studio Code extension, automatically include these
libraries when a sketch uses a function or p5
property that
they define. See automatic
library includes for more information.
Each library is listed with the symbols (functions, classes, and
variables), and the p5
properties, that it defines. A
JavaScript-only sketch that uses one of these symbols or
properties, and does not define it, causes the inclusion of the
library that defines that symbol.
This page is generated from the files in this directory.
The “Core” libraries from the official p5.js Libraries page.
This category includes only the p5.sound
library. It
does not include the p5.accessibility
library because, as
noted on that
library’s home page, it is obsolete.
p5.sound extends p5 with Web Audio functionality including audio input, playback, analysis and synthesis.
Defines:
createConvolver
freqToMidi
getAudioContext
getOutputVolume
loadSound
midiToFreq
outputVolume
sampleRate
saveSound
setBPM
soundFormats
soundOut
userStartAudio
p5.Amplitude
p5.AudioIn
p5.Convolver
p5.Delay
p5.Envelope
p5.FFT
p5.Filter
p5.MonoSynth
p5.Noise
p5.Oscillator
p5.Part
p5.Phrase
p5.PolySynth
p5.Pulse
p5.Reverb
p5.Score
p5.SoundFile
p5.SoundLop
p5.SoundRecorder
“Community” libraries from the official p5.js Libraries page.
This category excludes a couple of libraries that could not be automatically included: .
p5.asciiart is a simple and easy to use image-to-ASCII art converter for p5js.
Defines:
AsciiArt
A javascript library that enables communication between BLE devices and a p5 sketch.
Defines:
p5ble
With p5.bots you can interact with your Arduino (or other microprocessor) from within the browser. Use sensor data to drive a sketch; use a sketch to drive LEDs, motors, and more!
Defines:
p5.board
p5.serial
Event driven, easy-to-use button library.
Defines:
Clickable
CMYK color space for p5.js
Defines:
Cmyk
A collision detection library for 2D geometry in p5.js
Defines:
collideDebug
collidePointPoint
collidePointCircle
collidePointEllipse
collidePointRect
collidePointLine
collidePointArc
collideRectRect
collideCircleCircle
collideRectCircle
collideLineLine
collideLineCircle
collideLineRect
collidePointPoly
collideCirclePoly
collideRectPoly
collideLinePoly
collidePolyPoly
collidePointTriangle
createLoop provides a simple and structured library for creating animation loops in the browser.
Defines:
createloop
p5.dimensions extends p5.js’ vector functions to work in any number of dimensions.
Defines:
nDist
nDistSq
nDot
nLerp
nAdd
nSub
nMul
nDiv
nSetMag
nCross
nEqual
nNormalize
nMag
nMagSq
Simple 3D camera control with inertial pan, zoom, and rotate
Defines:
Dw
createEasyCam
p5.RoverCam
Extensive library for p5.js that adds additional event-listening functionality for creating canvas-based web applications
Defines:
uxRect
uxSquare
uxTriangle
uxCircle
uxEllipse
uxFillColor
uxnoFill
uxStroke
uxNoStroke
uxStrokeWeight
p5.func is a p5 extension that provides new objects and utilities for function generation in the time, frequency, and spatial domains
Defines:
imap
wrap
createArray
normalizeArray
resizeArray
multiplyArray
addArray
subtractArray
divideArray
moduloArray
sumArray
f2ib
ib2f
sinc
besselI0
fplot
p5.Gen
p5.Ease
p5.ArrayEval
p5.Filt
p5.FastFourierTransform
p5.geolocation provides techniques for acquiring, watching, calculating, and geofencing user locations for p5.js.
Defines:
geoCheck
getCurrentPosition
watchPosition
clearWatch
intervalCurrentPosition
clearIntervalPos
calcGeoDistance
geoFenceCircle
geoFencePolygon
grafica.js lets you add simple but highly configurable 2D plots to your p5.js sketches.
Defines:
GPlot
p5.gui generates a graphical user interface for your p5.js sketches.
Defines:
createGui
p5.localmessage provides a simple interface to send messages locally from one sketch to another for easy multi-window sketching
Defines:
registerServiceWorker
sendMessage
listenMessage
Raster to vector conversion, isosurfaces
Defines:
marchingSquares
Mappa provides a set of tools for working with static maps, tile maps, and geo-data. Useful when building geolocation-based visual representations
Defines:
Mappa
A friendly machine learning library for the web.
Defines:
ml5
p5.play provides sprites, animations, input and collision functions for games and gamelike applications
Defines:
createSprite
loadAnimation
The Particle and Fountain objects can be used to create data-driven effects that are defined through user structures or JSON input and user-draw functions
Defines:
Particle
Fountain
p5.Riso is a library for generating files suitable for Risograph printing. It helps turn your sketches into multi-color prints
Defines:
drawRiso
tools for generative natural language
Defines:
RiTa
Make knobs you can rotate with custom graphics and return value ranges
Defines:
MakeKnob
Helps you create sketches with multiple states / scenes
Defines:
SceneManager
p5js.screenPosition is a library that provides a function for getting the position of the mouse on the screen
Defines:
addScreenPositionFunction
Draw 2D primitives in a sketchy look
Defines:
Scribble
p5.serial enables serial communication between devices that support serial (RS-232) and p5 sketches running in the browser
Defines:
p5.SerialPort
Shape5 is a library for creating and manipulating shapes in p5.js
Defines:
Circle
Square
Triangle
Polygon
Oval
Rectangle
Semicircle
Rhombus
RightTriangle
IsoscelesTriangle
Stripe
A library built to add more simple shapes to the p5.js framework.
Defines:
tri
pent
hexagon
hept
octo
nona
heart
center
deca
trap
rightTri
p5.speech provides simple, clear access to the Web Speech and Speech Recognition APIs, allowing for the easy creation of sketches that can talk and listen
Defines:
p5.Speech
p5.SpeechRec
p5 extension for 2D static art using px, mm, cm or inches
Defines:
Add Tiled maps to p5.js.
Defines:
loadTiledMap
An easy-to-use touchscreen and mouse UI library for p5.js.
Defines:
createGui
Vida is a simple library that adds camera (or video) based motion detection and blob tracking functionality to p5js
Defines:
Vida
p5.voronoi is a library for creating Voronoi diagrams in p5.js
Defines:
voronoi
voronoiGetDiagram
A library for p5.js that allows coders to easily render p5.js sketches in AR/VR using WebXR
Defines:
createVRCanvas
p5.3D is a library for creating 3D graphics 3D Text and Images in WebGL
Defines:
createWord3D
createPicture3D
createCanvas3D
Libraries that are not specific to p5.js, but are particularly useful for p5 sketches.
Anime.js (/ˈæn.ə.meɪ/) is a lightweight JavaScript animation library with a simple, yet powerful API.
Defines:
anime
A library to capture canvas-based animations at a fixed framerate
Defines:
CCapture
dat.gui is a lightweight controller library for JavaScript. It provides a highly customizable user interface building block called dat.gui. It has no dependencies on other libraries. Use it to easily build powerful and flexible user interfaces.
Defines:
dat
Libraries that are not on the official p5.js Libraries page, but appear to be useful and well-maintained.
I’ve also included my own libraries from Oliver’s p5.js libraries.
Make it easier to use Graphics instances to make layers
Defines:
beginLayer
A p5.js library for adding gradients and repeating patterns to your sketches
Defines:
createPattern
fillPattern
strokePattern
backgroundPattern
createLinearGradient
createRadialGradient
createConicGradient
Gradient
fillGradient
strokeGradient
backgroundGradient
A pattern drawing library for p5.js.
Defines:
arcPattern
circlePattern
ellipsePattern
quadPattern
randPattern
rectPattern
squarePattern
trianglePattern
patternAngle
patternColors
beginContourPattern
beginShapePattern
endShapePattern
Add rotateAbout()
and scaleAbout()
functions to p5.js
Defines:
rotateAbout
scaleAbout
Modify the p5.js functions to accept Vector arguments
Defines:
enableVectorArguments