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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nano-banana-2-ai

v1773626.802.81

Published

Professional integration for https://nanaimg.app/

Downloads

36

Readme

nano-banana-2-ai

A lightweight JavaScript library for image processing and AI-powered enhancements. Provides essential tools for manipulating and improving images directly in your JavaScript environment.

Nano Banana 2 AI Image Generator

Installation

bash npm install nano-banana-2-ai

Usage Examples

Below are several practical examples demonstrating how to utilize nano-banana-2-ai in various JavaScript environments.

1. Basic Image Resizing (Browser): javascript import { resizeImage } from 'nano-banana-2-ai';

const imageElement = document.getElementById('myImage');

resizeImage(imageElement, { width: 200, height: 150 }) .then(resizedImage => { // resizedImage is a data URL representing the resized image document.getElementById('resizedImage').src = resizedImage; }) .catch(error => { console.error("Error resizing image:", error); });

2. Image Enhancement (Node.js): javascript const { enhanceImage } = require('nano-banana-2-ai'); const fs = require('fs');

fs.readFile('input.jpg', (err, data) => { if (err) { console.error("Error reading file:", err); return; }

enhanceImage(data) .then(enhancedBuffer => { fs.writeFile('output.jpg', enhancedBuffer, (err) => { if (err) { console.error("Error writing file:", err); } else { console.log("Image enhanced and saved as output.jpg"); } }); }) .catch(error => { console.error("Error enhancing image:", error); }); });

3. Converting Image to Grayscale (Browser): javascript import { grayscaleImage } from 'nano-banana-2-ai';

const imageElement = document.getElementById('colorImage');

grayscaleImage(imageElement) .then(grayscaleDataURL => { document.getElementById('grayscaleImage').src = grayscaleDataURL; }) .catch(error => { console.error("Error converting to grayscale:", error); });

4. Applying a Sepia Filter (Node.js): javascript const { sepiaFilter } = require('nano-banana-2-ai'); const fs = require('fs');

fs.readFile('input.png', (err, data) => { if (err) { console.error("Error reading file:", err); return; }

sepiaFilter(data) .then(sepiaBuffer => { fs.writeFile('sepia_output.png', sepiaBuffer, (err) => { if (err) { console.error("Error writing file:", err); } else { console.log("Sepia filter applied and saved as sepia_output.png"); } }); }) .catch(error => { console.error("Error applying sepia filter:", error); }); });

5. Getting Image Dimensions (Browser): javascript import { getImageDimensions } from 'nano-banana-2-ai';

const imageElement = document.getElementById('sourceImage');

getImageDimensions(imageElement) .then(dimensions => { console.log("Image Width:", dimensions.width); console.log("Image Height:", dimensions.height); }) .catch(error => { console.error("Error getting dimensions:", error); });

API Summary

  • resizeImage(image, options): Resizes an image.

    • image: An HTMLImageElement (browser) or a Buffer/Uint8Array (Node.js).
    • options: An object with width and height properties (numbers).
    • Returns: A Promise that resolves with a data URL (browser) or a Buffer (Node.js) representing the resized image.
  • enhanceImage(image): Enhances the quality of an image.

    • image: A Buffer/Uint8Array (Node.js) or an HTMLImageElement (browser).
    • Returns: A Promise that resolves with a data URL (browser) or a Buffer (Node.js) representing the enhanced image.
  • grayscaleImage(image): Converts an image to grayscale.

    • image: An HTMLImageElement (browser) or a Buffer/Uint8Array (Node.js).
    • Returns: A Promise that resolves with a data URL (browser) or a Buffer (Node.js) representing the grayscale image.
  • sepiaFilter(image): Applies a sepia filter to an image.

    • image: A Buffer/Uint8Array (Node.js) or an HTMLImageElement (browser).
    • Returns: A Promise that resolves with a data URL (browser) or a Buffer (Node.js) representing the sepia-toned image.
  • getImageDimensions(image): Retrieves the dimensions of an image.

    • image: An HTMLImageElement (browser) or a Buffer/Uint8Array (Node.js).
    • Returns: A Promise that resolves with an object containing width and height properties (numbers).

License

MIT

This package is part of the nano-banana-2-ai ecosystem. Explore the Nano Banana 2 AI Image Generator for advanced features and enterprise-grade tools.