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

pixon-image

v1.1.3

Published

Cross-platform, prebuilt, high-performance image processing library built on libvips

Readme

# Pixon

> A fast, native Node.js image processing library with chainable async APIs, inspired by Sharp.

Pixon is a lightweight, high-performance image manipulation library built on a C++ addon. It supports resizing, cropping, rotating, flipping, color adjustments, brightness enhancement, filters, and more — all via a simple, chainable API.

---


## Features

- Async, chainable image operations:
  - Resize, Crop, Rotate
  - Flip, Flop
  - Adjust brightness, contrast, saturation
  - Grayscale, Blur, Sharpen
  - Composite images
  - Rounded corners
- Supports JPEG, PNG, WEBP, and more
- Optional stream-based processing (currently file-based)
- High-performance native addon powered by C++

---

## Installation

### From npm

```bash
npm install pixon-image

This will download a prebuilt binary if available for your OS, or compile the C++ addon automatically.

From source / GitHub

git clone https://github.com/sudiplahiri3123-alt/pixon.git
cd pixon
npm install

Usage

Basic Example

const pixon = require('pixon-image');

(async () => {
  const img = pixon('input.png');

  await img.resize(600, 400);
  await img.sharpen(1.0);
  await img.adjust(10, 1.1, 1); // brightness, contrast, saturation
  await img.roundCorners(6);
  await img.toFile('output_final.jpg');

  console.log('✅ Saved output: output_final.jpg');
})();

Stream Example (File-Based)

const path = require('path');
const pixon = require('pixon-image');

(async () => {
  const inputPath = path.join(__dirname, 'input.png');
  const outputPath = path.join(__dirname, 'output_stream.jpg');

  const img = pixon(inputPath);

  await img.resize(400, 300);
  await img.sharpen(1.5);
  await img.grayscale();
  await img.toFile(outputPath);

  console.log(`✅ Image processed and saved: ${outputPath}`);
})();

Benchmarking

You can measure performance of each operation using the included benchmark.js example:

node examples/benchmark.js

It will print the time taken for each operation like resize, sharpen, adjust, etc.


API Reference

All methods are async and chainable:

| Method | Description | | ---------------------------------------------------- | --------------------- | | resize(width, height, crop = false) | Resize image | | crop(left, top, width, height) | Crop image | | rotate(angle) | Rotate image | | flip() | Flip vertically | | flop() | Flip horizontally | | adjust(brightness, contrast, saturation) | Adjust image colors | | colorfulEnhance() | Adjust to vibrant | | brightnessEnhance() | Enhance brightness | | removeColor() | Remove colors | | softGray() | Soft grayscale effect | | grayscale() | Convert to grayscale | | blur(sigma) | Apply Gaussian blur | | sharpen(sigma) | Sharpen image | | composite(overlayPathOrBuffer, left, top, opacity) | Overlay another image | | roundCorners(radius) | Apply rounded corners | | toBuffer(format = '.jpg', quality = 90) | Get image as Buffer | | toFile(outPath, format = '.jpg', quality = 90) | Save image to file |


Utilities

  • createRoundedMask(width, height, radius) — Create in-memory rounded corner mask (PNG buffer).

Stream Wrappers

  • createResizeStream, createCropStream, createRotateStream, etc.

Currently file-based; in-memory streaming coming soon.


Contributing

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

License

MIT © [Sudip Lahiri]


Notes

  • Requires Node.js >= 16
  • C++ build environment required for local compilation (node-gyp dependencies)
  • Prebuilt binaries will be added in future releases to simplify installation

Assets

Look at the examples/ directory for benchmark and test files using input.png. input.png is free to use from Pexels.

Badges

npm License Downloads Build

Table of Contents


---