Registry / data / image-parser

image-parser

JSON →
library1.2.9jsnpmunverified

image-parser is a JavaScript library designed for parsing and basic manipulation of images. It primarily leverages `lwip` for image processing, with a mentioned fallback to GraphicsMagick, though the direct integration of GraphicsMagick is not clearly detailed in the quickstart. The current stable version is 1.2.9, with recent releases focusing on documentation updates and maintainer support links rather than feature development. This indicates the project is in a maintenance mode. A key characteristic is its reliance on `lwip`, a library that itself has seen limited maintenance and can present challenges with newer Node.js versions or platform compatibility due to its native dependencies. It allows for parsing image data, accessing individual pixels, resizing, cropping, and saving images.

dataserialization
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This package is CommonJS-only. Direct ES module import syntax is not supported without a CommonJS wrapper or bundler.

const ImageParser = require("image-parser");

Demonstrates how to parse an image from a URL, retrieve its dimensions and pixel data, then resize it and save the modified image to a local file.

const ImageParser = require("image-parser"); const path = require("path"); const fs = require("fs"); // Ensure the output directory exists for saving images const outputDir = path.join(__dirname, 'output'); if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir); } const imageUrl = "https://octodex.github.com/images/privateinvestocat.jpg"; console.log(`Parsing image from: ${imageUrl}`); let img = new ImageParser(imageUrl); img.parse(err => { if (err) { console.error("Error parsing image:", err); return; } console.log("Image successfully parsed."); console.log("Image width:", img.width()); console.log("Image height:", img.height()); console.log("Pixel at (3,3):", img.getPixel(3, 3)); // Example of resizing and saving the image const newWidth = 100; const newHeight = 100; console.log(`Resizing image to ${newWidth}x${newHeight}...`); img.resize(newWidth, newHeight, (resizeErr) => { if (resizeErr) { console.error("Error resizing image:", resizeErr); return; } const outputPath = path.join(outputDir, "resized-image.jpg"); console.log(`Saving resized image to ${outputPath}...`); img.save(outputPath, (saveErr) => { if (saveErr) { console.error("Error saving image:", saveErr); } else { console.log(`Resized image saved successfully.`); } }); }); });
Debug
Known footguns
breakingThe underlying `lwip` library, which `image-parser` heavily relies on, is largely unmaintained and has known compatibility issues with newer Node.js versions (e.g., Node.js 12+ or 14+ may fail to compile native modules). This can lead to installation failures or runtime errors.
gotchaThis package appears to be in maintenance mode, with recent releases primarily addressing documentation and maintainer support links. New features are unlikely, and long-term compatibility with evolving Node.js ecosystems is a significant concern due to its dependency on `lwip`.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
12 hits · last 30 days
gptbot
4
ahrefsbot
4
bingbot
3
script
1
Resources