A plugin collection for paint.js.
Plugins can add effects, adjustments, and file-type support. Users can install them through the plugin browser in paint.js or by importing a .paintjs package directly.
Each plugin has its own directory under plugins/:
plugins/example-plugin/
├── plugin.json
├── plugin.js
├── package.json
└── assets/
└── icon.png
plugin.jsoncontains the plugin metadata.plugin.jsregisters the plugin and implements its behavior.package.jsonis only needed when the plugin uses npm dependencies.assets/is optional and contains images or other files used by the plugin.
Use paintDotJs.asset("icon.png") to reference a packaged asset from plugin.js.
Install the dependencies and build the plugin catalog:
npm ci
npm run buildThe generated .paintjs packages and catalog.json are written to dist/.
To develop one plugin, launch paint.js with it already loaded:
npm run dev -- example-pluginThe command opens a clean desktop instance and reloads the plugin whenever a file in its directory changes. Press F12 to open DevTools. Set PAINTDOTJS_PATH if the paint.js checkout is not next to this repository.
- Create a new directory under
plugins/. - Add
plugin.jsonandplugin.js. - Add any optional files to
assets/. - Run
npm run dev -- <plugin-directory>and test it in paint.js. - Run
npm run buildbefore committing.
Use another plugin in this repository as a starting point. Keep metadata in plugin.json; plugin.js should contain only the implementation and registration.
The paint.js plugin API guide explains plugin registration, effects, controls, whole-image rendering, file types, assets, and workers.
Format plugin source files with:
npm run format