npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

eigc

v1.0.0

Published

Elite India Graphics Converter - A powerful Node.js native add-on for comprehensive image and document conversion

Downloads

6

Readme

EIGC - Elite India Graphics Converter

NPM Version NPM Downloads License: MIT

EIGC is a powerful Node.js native add-on for comprehensive image and document conversion. Convert HTML to images, rasterize graphics, vectorize images, and transform between multiple formats with enterprise-grade performance.

🚀 Features

  • HTML to Raster: Convert websites and HTML files to high-quality images (PNG, JPG, WEBP)
  • Raster to SVG: Vectorize raster images with advanced tracing algorithms
  • SVG to Raster: Render SVG graphics to pixel-perfect raster images
  • Format Conversion: Transform between PNG, JPG, WEBP, and other formats
  • Chrome Integration: Pixel-perfect website screenshots using headless Chrome
  • High Performance: Native C++ module with Java integration for speed
  • Cross Platform: Works on Windows, macOS, and Linux

📦 Installation

Step 1: Install Java Runtime

EIGC requires Java Runtime Environment (JRE) 8 or higher.

macOS

# Using Homebrew (recommended)
brew install openjdk@17

# Or download from: https://adoptium.net/

Linux (Ubuntu/Debian)

# Install OpenJDK
sudo apt-get update
sudo apt-get install openjdk-17-jre

# Verify installation
java -version

Windows

  1. Download Java from Adoptium
  2. Install and add to PATH
  3. Verify with java -version in Command Prompt

Step 2: Install EIGC

npm install eigc

Step 3: Verify Installation

const EIGC = require('eigc');
const converter = new EIGC();
console.log('✅ EIGC installed successfully!');

🔧 Quick Start

Basic Setup

const EIGC = require('eigc');

// Initialize converter
const converter = new EIGC();

// Set Chrome Driver version (required for HTML conversions)
EIGC.GOOGLE_CHROME_DRIVER_VERSION = "130.0.6723.58";

Convert Image to SVG

async function convertToSvg() {
  try {
    await converter.rasterToSvg({
      input: "./photo.png",
      output: "./vector.svg",
      scale: "1.0",
      colorReduction: "64"
    });
    console.log("✅ Image converted to SVG!");
  } catch (error) {
    console.error("❌ Conversion failed:", error.message);
  }
}

convertToSvg();

Convert Website to Image

async function screenshotWebsite() {
  try {
    await converter.htmlToRaster({
      input: "https://example.com",
      output: "./screenshot.png",
      width: "1920",
      height: "1080",
      dpi: "300"
    });
    console.log("✅ Website screenshot saved!");
  } catch (error) {
    console.error("❌ Screenshot failed:", error.message);
  }
}

screenshotWebsite();

📖 API Reference

Available Methods

rasterToSvg(options)

Convert raster images (PNG, JPG, etc.) to SVG vector graphics.

await converter.rasterToSvg({
  input: "./image.png",      // Input image file
  output: "./vector.svg",    // Output SVG file
  scale: "1.0",             // Scaling factor (optional)
  colorReduction: "64"      // Number of colors (optional)
});

htmlToRaster(options)

Convert HTML content or websites to raster images.

await converter.htmlToRaster({
  input: "https://example.com",  // URL or HTML file path
  output: "./screenshot.png",     // Output image file
  width: "1920",                 // Image width (optional)
  height: "1080",                // Image height (optional)
  dpi: "300"                     // Resolution (optional)
});

svgToRaster(options)

Convert SVG graphics to raster images.

await converter.svgToRaster({
  input: "./vector.svg",     // Input SVG file
  output: "./image.png",     // Output image file
  format: "png",            // Output format
  width: "800",             // Output width
  height: "600"             // Output height
});

rasterToRaster(options)

Convert between different raster image formats.

await converter.rasterToRaster({
  input: "./image.png",      // Input image file
  output: "./image.jpg",     // Output image file
  format: "jpg",            // Output format
  quality: "0.9"            // Compression quality (optional)
});

💡 Examples

Complete Example

const EIGC = require('eigc');

async function main() {
  const converter = new EIGC();
  
  // Set Chrome driver version for HTML conversions
  EIGC.GOOGLE_CHROME_DRIVER_VERSION = "130.0.6723.58";
  
  try {
    // Convert image to SVG
    await converter.rasterToSvg({
      input: "./photo.png",
      output: "./vector.svg",
      colorReduction: "32"
    });
    
    // Convert website to image
    await converter.htmlToRaster({
      input: "https://example.com",
      output: "./website.png",
      width: "1200",
      height: "800"
    });
    
    console.log("✅ All conversions completed!");
    
  } catch (error) {
    console.error("❌ Error:", error.message);
  }
}

main();

Batch Processing

const images = ["photo1.png", "photo2.png", "photo3.png"];

for (const image of images) {
  await converter.rasterToRaster({
    input: `./input/${image}`,
    output: `./output/${image.replace('.png', '.jpg')}`,
    format: "jpg",
    quality: "0.9"
  });
}

�️ Troubleshooting

Common Issues

"Java not found" or "JVM initialization failed"

# Check if Java is installed
java -version

# Install Java if missing (macOS)
brew install openjdk@17

# Install Java if missing (Ubuntu/Debian)
sudo apt-get install openjdk-17-jre

"Chrome Driver version mismatch" (for HTML conversions)

// Update Chrome Driver version to match your browser
EIGC.GOOGLE_CHROME_DRIVER_VERSION = "130.0.6723.58";

// Check your Chrome version:
// Chrome -> About Google Chrome

Module installation issues

# Clear NPM cache and reinstall
npm cache clean --force
rm -rf node_modules package-lock.json
npm install eigc

Requirements

  • Node.js: 14.0.0 or higher
  • Java: JRE 8 or higher (required)
  • Memory: 2GB available RAM
  • Storage: 500MB free space

🆘 Support

📄 License

MIT License - see the LICENSE file for details.

� Author

Saleem Ahmad - Elite India


Star this project if it helps you! | � Available on NPM