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

collageify

v1.0.0

Published

accepts images, creates a collage, and downloads it as a file, get the dominant colors in the uploaded image

Readme

collageify

accepts images, creates a collage, and downloads it as a file, get the dominant colors in the uploaded image. npm npm downloads License build

📸 Collageify

Collageify is a lightweight TypeScript library that allows you to:

  • Create beautiful image collages in the browser
  • Extract dominant color codes from uploaded images
  • Download the final collage as a PNG file

Perfect for creative tools, photo editors, and AI image apps!


✨ Features

  • 🖼️ Render collages from multiple images using HTML5 canvas
  • 🎨 Get top dominant colors from any image (hex codes)
  • 📥 Download the final collage in one click
  • ⚙️ Customizable grid (rows, columns, padding, background)
  • 💡 Supports file input or image URLs (in browser)

🚀 Installation

npm install collageify

or

yarn add collageify

📜 Example Usage (Browser)

// Example : 1
import { createCollage, downloadCanvas } from 'collagify';

const files = [...]; // File[] from <input type="file" multiple>
createCollage({ images: files, rows: 2, cols: 2 }).then(canvas => {
  document.body.appendChild(canvas); // optional preview
  downloadCanvas(canvas); // triggers download
});

👉 Create a Collage

// Example : 2
import { createCollage, downloadCanvas } from "collageify";

const files = [
  /* File[] from <input type="file" multiple /> */
];

const canvas = await createCollage({
  images: files,
  rows: 2,
  cols: 2,
  width: 800,
  height: 800,
  padding: 10,
  backgroundColor: "#ffffff",
});

document.body.appendChild(canvas); // Preview

downloadCanvas(canvas, "my-collage.png"); // Trigger download

🎨 Extract Dominant Colors

import { getDominantColorsFromImage } from "collageify";

const file = myFileInput.files[0];

const colors = await getDominantColorsFromImage(file, 5);

console.log("Top colors:", colors); // ['#AABBCC', '#FF1234', ...]

📚 API Reference

createCollage(options: CollageOptions): Promise<HTMLCanvasElement>
| Option            | Type                 | Default   | Description               |
| ----------------- | -------------------- | --------- | ------------------------- |
| `images`          | `File[] \| string[]` | –         | Image sources             |
| `rows`            | `number`             | `2`       | Number of collage rows    |
| `cols`            | `number`             | `2`       | Number of collage columns |
| `width`           | `number`             | `800`     | Final collage width (px)  |
| `height`          | `number`             | `800`     | Final collage height (px) |
| `padding`         | `number`             | `10`      | Spacing between images    |
| `backgroundColor` | `string`             | `#ffffff` | Canvas background color   |
getDominantColorsFromImage(file: File, colorCount?: number): Promise<string[]>
Returns an array of hex color codes (#RRGGBB) extracted from the image.

downloadCanvas(canvas: HTMLCanvasElement, filename?: string): void
Downloads the canvas as a .png file.

👨‍💻 Author Made with ❤️ by rajasekar-arch [email protected]