virtron-art
v1.0.0
Published
A CommonJS-compatible library to create pixel art from images using Canvas API.
Maintainers
Readme
Virtron Art
A library to generate pixel art from images using the Canvas API. Compatible with Node.js and CommonJS.
Installation
npm install virtron-art
const PixelArt = require('virtron-art');
// Example usage in the browser
const canvas = document.getElementById('canvas');
const pixelArt = new PixelArt(canvas);
// Load an image
const fileInput = document.getElementById('fileInput');
fileInput.addEventListener('change', (event) => {
const file = event.target.files[0];
pixelArt.loadImage(file).then(() => {
console.log('Image loaded!');
});
});
// Generate pixel art
pixelArt.generatePixelArt(8);
// Export image
const imageURL = pixelArt.exportImage();
console.log('Exported image URL:', imageURL);
---
## **6. Publish Your Package**
1. Log in to npm:
```bash
npm login
