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

paradimg

v0.1.1

Published

Browser-side image URL modifiers and canvas effects.

Downloads

139

Readme

Paradimg

Browser-side image processing controlled through URL fragments.

Paradimg v0.1.0

By Rémino Rem
https://remino.net/

Docs | Code Repo | npm Package



Installation

HTML (CDN)

Process marked image URLs automatically from a CDN:

<script src="https://unpkg.com/paradimg"></script>

Mirrors:

  • https://unpkg.com/paradimg
  • https://cdn.jsdelivr.net/npm/paradimg

Use a pinned version in production:

<script src="https://unpkg.com/[email protected]"></script>

npm

Install the package first:

npm install paradimg

Then process matching images automatically:

import 'paradimg/auto'

Or call the explicit API when the page is ready:

import { processImages } from 'paradimg'

await processImages()

Direct download

Download the package tarball or individual files from npm/CDN:

  • https://www.npmjs.com/package/paradimg
  • https://unpkg.com/paradimg/dist/
  • https://cdn.jsdelivr.net/npm/paradimg/dist/

The browser-ready auto-registration file is dist/paradimg-auto.min.js.

Distribution files:

  • dist/paradimg.mjs: ES module library API.
  • dist/paradimg.cjs: CommonJS library API.
  • dist/paradimg-auto.mjs: ES module automatic entry.
  • dist/paradimg-auto.cjs: CommonJS automatic entry.
  • dist/paradimg-auto.min.js: minified classic browser automatic entry.

Back to top


Usage

Add modifiers after #? in an image URL. They run from left to right.

<img src="portrait.avif#?half&dither=4x4,8c" alt="A pixelated portrait" />

Paradimg selects img[src*="#?"], decodes the source image, renders each requested effect to a Canvas, then replaces the image with a PNG object URL. The original URL remains available in data-image-processor-original-src.

Back to top


URL modifiers

| Modifier | Description | | --- | --- | | brightness=1.15 | Multiplies each RGB channel. Defaults to 1.15. | | contrast=1.2 | Adjusts contrast around a midpoint of 128. Defaults to 1.2. | | bw | Converts to grayscale. Use bw=invert or bw=threshold for variants. | | half | Resizes the image to 50% with smoothing. | | double | Resizes to 200% with pixelated nearest-neighbour scaling. | | dither | Applies an 8×8, 8-colour ordered dither. | | dither=4x4,4c | Chooses a Bayer matrix (2x2, 4x4, 8x8, 16x16, none) and colour levels (2c, 4c, 8c). | | dither=8x8,bw | Uses two-level monochrome ordered dithering. |

Layout fragments can coexist with modifiers. Paradimg ignores unknown flags, so an application can keep flags such as large or full for its own CSS:

<img src="photo.jpg#?large&dither=4x4,4c" alt="Dithered photo" />

Back to top


API

The package exports the processor and every built-in plugin:

import {
  ImageProcessor,
  brightness,
  bw,
  contrast,
  createImageProcessor,
  dither,
  double,
  half,
  parseHashFlags,
  processImages,
} from 'paradimg'

processImages(options?) builds a default processor and resolves after every matching image has been processed. createImageProcessor(options?) returns that processor without running it. parseHashFlags(src) exposes the fragment parser.

Back to top


Custom pipelines

Use only the effects and selector your page needs:

import { ImageProcessor, dither, half } from 'paradimg'

const processor = new ImageProcessor([half, dither], 'img[data-pixel-art]')
await processor.processImages()

Plugins have a keyword and an async process(img, context) method. Register your own plugin to introduce an application-specific URL modifier.

Back to top


Behaviour

Dithered images are clickable after processing: clicking swaps between the processed PNG and the original source. This is useful for inspecting an effect without a separate before/after UI.

Paradimg is browser-only because it uses <canvas> and HTMLImageElement. For a no-JavaScript baseline, generate static derivatives at build time and use Paradimg as an optional enhancement.

Back to top


Development

npm install
npm run build
npm test

Use Node 22.12 or newer. npm run build produces the npm library and the Astro documentation site. npm run release:dry-run previews the release-it workflow.

Back to top


Licence

ISC. See LICENSE.md.