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

@crispcut/background-removal

v1.1.2

Published

AI background removal for clip art, t-shirt designs, and POD assets. Both models trained at 1024×1024. Runs in the browser via ONNX Runtime.

Readme

✂ CrispCut

Background removal that just works. Built for designs, not photos.

Clip art · T-shirt graphics · Print-on-demand assets

Runs in the browser. Nothing uploaded. Two models trained at 1024×1024.

npm Model on HF


Install

npm i @crispcut/background-removal

Use

import { cut } from '@crispcut/background-removal';

const result = await cut(image);
img.src = result.url;

That's it. One function, one result.

GPU

const result = await cut(image, { gpu: true });

Auto-picks the best backend (WebGPU → WebGL). Falls back to CPU silently if GPU isn't available.

Quality model

const result = await cut(image, { model: 'quality', gpu: true });

Trim

Auto-crop transparent padding — perfect for clip art and POD assets:

const result = await cut(image, { trim: true });

// Keep 10px padding around the subject
const result = await cut(image, { trim: 10 });

Smooth edges

Edges are feathered by default for clean alpha transitions. Adjust or disable:

await cut(image);                 // smooth: true (default — 2px feather)
await cut(image, { smooth: 5 }); // heavier feather
await cut(image, { smooth: false }); // hard edges

Progress

await cut(image, {
  onProgress: p => {
    bar.style.width = `${Math.round(p * 100)}%`;
  },
});

Download

const result = await cut(image);
result.download();               // → crispcut-result.png
result.download('my-file.png');  // custom filename

Clean up

result.revoke();  // free the object URL when done

Batch

import { cutAll } from '@crispcut/background-removal';

const results = await cutAll([file1, file2, file3], { gpu: true });

// With per-image callback
await cutAll(files, { trim: true }, (i, total, result) => {
  console.log(`${i + 1}/${total} done`);
});

Two models

| | 'fast' (default) | 'quality' | |---|---|---| | Size | 6.5 MB | 30.8 MB | | CPU | ~5–10 s | ~25–45 s | | GPU | ~1–2 s | ~5–10 s | | Architecture | MobileNetV2 UNet | EfficientNet-b5 UNet++ SCSE |

Both trained at 1024×1024 on design-specific content. INT8 quantized.


All options

await cut(image, {
  model:      'fast',        // 'fast' | 'quality'
  gpu:        false,         // use GPU — auto-picks best, falls back gracefully
  edge:       0.5,           // 0–1, higher = tighter crop
  smooth:     true,          // true | false | number (feather px)
  trim:       false,         // true | false | number (padding px)
  format:     'image/png',   // 'image/png' | 'image/webp'
  quality:    0.92,          // webp quality
  modelUrl:   undefined,     // override for self-hosting
  onProgress: undefined,     // (progress: number) => void — 0 to 1
});

Result

const result = await cut(image);

result.url        // object URL for <img src>
result.blob       // PNG Blob
result.width      // output width (trimmed if trim was used)
result.height     // output height
result.model      // 'fast' | 'quality'
result.time       // ms
result.download() // trigger browser download
result.revoke()   // release object URL

Preload

import { preload } from '@crispcut/background-removal';

preload();                                // warm up fast model
preload({ model: 'quality', gpu: true }); // warm up quality + GPU

Clear cache

import { clearCache } from '@crispcut/background-removal';

clearCache();            // free both
clearCache('quality');   // free one

React

import { cut } from '@crispcut/background-removal';
import { useState } from 'react';

export function BgRemover() {
  const [src, setSrc] = useState(null);

  async function handle(e) {
    const file = e.target.files[0];
    if (!file) return;
    const { url } = await cut(file, { gpu: true, trim: true });
    setSrc(url);
  }

  return (
    <>
      <input type="file" accept="image/*" onChange={handle} />
      {src && <img src={src} />}
    </>
  );
}

Vite

export default {
  optimizeDeps: { exclude: ['onnxruntime-web'] },
};

Self-hosting

cut(image, { modelUrl: '/models/crispcut-fast.onnx' });

Models: huggingface.co/bowespublishing/crisp-cut


License

Package — MIT

Model weights — AGPL-3.0 / Commercial

📩 [email protected]