whatisgithub

What is paper.js?

paperjs/paper.js — explained in plain English

Analysis updated 2026-06-24 · repo last pushed 2024-07-23

15,033JavaScriptAudience · developerComplexity · 3/5StaleSetup · moderate

In one sentence

Paper.js is a JavaScript library for drawing and manipulating vector graphics on the HTML5 Canvas, with an optional PaperScript flavor for math-friendly point and color operations.

Mindmap

mindmap
  root((paper.js))
    Inputs
      Shapes and paths
      SVG files
      PaperScript code
    Outputs
      Canvas drawings
      SVG export
      Headless renders
    Use Cases
      Interactive graphics
      Generative art
      Diagram editors
    Tech Stack
      JavaScript
      HTML5 Canvas
      Node.js
      Cairo
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build an interactive vector drawing app that runs in the browser

USE CASE 2

Generate SVG output from a Node.js script using paper-jsdom

USE CASE 3

Render canvas graphics headlessly on a server with paper-jsdom-canvas

USE CASE 4

Write generative art using the PaperScript syntax with point and color math

What is it built with?

JavaScriptHTML5 CanvasNode.jsCairoPangoGulp

How does it compare?

paperjs/paper.jskriskowal/qjosdejong/mathjs
Stars15,03315,03715,028
LanguageJavaScriptJavaScriptJavaScript
Last pushed2024-07-232023-11-082026-05-12
MaintenanceStaleDormantMaintained
Setup difficultymoderateeasyeasy
Complexity3/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Browser use is one npm install, but the Node canvas variant needs Cairo and Pango installed via the system package manager.

So what is it?

Paper.js is a JavaScript library for drawing and manipulating vector graphics in the browser. Vector graphics are pictures defined by shapes, paths, and curves rather than by a grid of pixels, which is what makes them stay sharp at any zoom level. The library draws onto the HTML5 Canvas element, the part of a web page where scripts can paint freely. The project bills itself as the Swiss Army Knife of vector graphics scripting. It is a JavaScript port of Scriptographer, an older scripting environment for Adobe Illustrator, and it was created by the authors of that earlier project. Beyond using it as a normal JavaScript library, Paper.js also offers PaperScript, a small flavor of JavaScript with extras such as math operators that work on points and colors directly. You install it with npm. There are three packages: paper for use in the browser, paper-jsdom for headless use in Node.js with SVG import and export, and paper-jsdom-canvas for headless Node.js use that also renders to a canvas. The canvas variant builds against the native Cairo and Pango graphics libraries, so the README walks through installing those on macOS, on Debian and Ubuntu Linux, and for Electron apps. The distributed files come in two variants: paper-full.js, which includes PaperScript and the Acorn.js parser it depends on, and paper-core.js, which is smaller and is meant for people writing plain JavaScript. Each variant also has a minified version. The README also documents the development setup, which uses yarn and Gulp to build the library from many source files in the src folder into the distributable files in dist. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Set up paper.js in a fresh HTML page and draw a circle that follows the mouse cursor
Prompt 2
Show me how to import an SVG file with paper.js and recolor every path inside it
Prompt 3
Write a PaperScript sketch that draws 100 randomly placed bezier curves animated over time
Prompt 4
Install paper-jsdom-canvas on Ubuntu and render a PNG of a star shape from a Node script
Prompt 5
Convert a vanilla JavaScript paper.js sketch into a React component that mounts and unmounts cleanly

Frequently asked questions

What is paper.js?

Paper.js is a JavaScript library for drawing and manipulating vector graphics on the HTML5 Canvas, with an optional PaperScript flavor for math-friendly point and color operations.

What language is paper.js written in?

Mainly JavaScript. The stack also includes JavaScript, HTML5 Canvas, Node.js.

Is paper.js actively maintained?

Stale — no commits in 1-2 years (last push 2024-07-23).

How hard is paper.js to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is paper.js for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.