JSPM

virtron-art

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q21583F
    • License MIT

    A CommonJS-compatible library to create pixel art from images using Canvas API.

    Package Exports

    • virtron-art
    • virtron-art/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (virtron-art) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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