PXON
A JavaScript module for importing, creating, manipulating, and exporting PXON data.
Installation
npm install pxon
And then import it:
// using es modules; // common.jsconst PXON = default; // AMD// I've forgotten but it should work.
Or use script tags and globals.
And then grab it off the global like so:
const PXON = PXONdefault;
Example Usage
const PXON = default;const pxon = ; // Import PXON-formatted JSON.pxon; // Set some EXIF data.pxonartist = "Matthew Hudson";pxonsoftware = "https://make8bitart.com/"; // Set a single pixel's value.pxon; // Iterate over an ES6 HashMap of all pixels.for let key pixel of pxonpixels console; // <- 0:0, { x: 0, y: 0, size: 1, color: 'rgba(0, 0, 0, 1)' } // Returns a PXON-formatted object.console;
Full API Documentation →
Additional Resources
- PXON Specification - specs for the "pixel art object notation" format
- make8bitart.com - pixel art painting app
- pxonloop - a pxon playground
- image-to-pxon - app that converts image to pxon
Notes
- The non-canonical
dataURL
field is not currently supported. - The non-canonical
size
field defaults to1
.