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

@pumpkinzzzzz/jyva

v1.0.0

Published

Jyva is a minimalist image transformation toolkit inspired by the aesthetic of Low-tech Magazine. It allows you to convert images into compressed monochrome PNGs using grayscale quantization, customizable dithering algorithms (like Floyd–Steinberg), and o

Readme

Jyva

Jyva is a minimalist image transformation toolkit inspired by the aesthetic of Low-tech Magazine. It allows you to convert images into compressed monochrome PNGs using grayscale quantization, customizable dithering algorithms (like Bayer dithering), and optional color tinting. Ideal for eco web design.

This is WIDELY inspired by this article How to build a Low-tech Website. And i want to thanks again lowtechmagazine for the work they do. They are really cool take a look.

Visual Example

Here's how Jyva transforms your images through each step:

| Original | Grayscale | Dithered | Green Tinted | |----------|-----------|----------|--------------| | Original | Grayscale | Dithered | Green |

Installation

npm install

Make sure you have the required dependencies:

  • pngjs for PNG manipulation
  • upng-js for PNG-8 palette encoding
  • TypeScript for development

Usage

Basic Example

Original to Grayscale

import fs from "fs";
import { PNG } from "pngjs";
import { toGrayscale } from "./core/grayscale";
import { bayerDither, makeGreen } from "./core/floyds_steinberg";
import { encodePNG8 } from "./core/palette";

// Load your image
const input = PNG.sync.read(fs.readFileSync("your-image.png"));
const rgba = new Uint8ClampedArray(input.data.buffer, input.data.byteOffset, input.data.byteLength);

// Apply transformations
const gray = toGrayscale(rgba);
const dithered = bayerDither(gray, input.width, 4, 8);
const tinted = makeGreen(dithered);

// Save as PNG-8 with palette
const png8bytes = encodePNG8(tinted, input.width, input.height);
fs.writeFileSync("output.png", png8bytes);

Available Functions

1. Grayscale Conversion

Grayscale Result

The toGrayscale function converts color images to grayscale using the standard luminance formula:

const gray = toGrayscale(rgba, 4); // 4 gray levels

Effect: Converts color image to monochrome

  • Uses luminance weighting (0.299×R + 0.587×G + 0.114×B)
  • Quantizes to specified number of gray levels
  • Preserves image detail while reducing color complexity

2. Bayer Dithering

Dithered Result

The bayerDither function applies ordered dithering using Bayer matrices:

const dithered = bayerDither(gray, width, 4, 8);
// 4 = number of gray levels
// 8 = Bayer matrix size (2, 4, or 8 supported)

Effect: Adds texture and reduces color banding

  • Creates patterned noise for smoother gradients
  • Matrix size 8 provides smoother transitions than 4
  • Distinctive retro/low-tech aesthetic

3. Color Tinting

Tinted Result

The makeGreen function applies a subtle green tint:

const tinted = makeGreen(dithered);

Effect: Applies characteristic green colorization

  • Green color cast (R×0.85, G×1.0, B×0.75)
  • Maintains the dithered pattern
  • Creates the Low-tech Magazine aesthetic

Complete Workflow

The typical Jyva workflow processes an image through four stages:

  1. OriginalGrayscale: Color to monochrome conversion
  2. GrayscaleDithered: Adds texture and reduces banding
  3. DitheredTinted: Applies characteristic green colorization

Each step progressively reduces file size while maintaining visual appeal, perfect for sustainable web design.

Development

Run the test script to see the full pipeline in action:

npm run dev

This will process testpictures/mononoke.png and generate all intermediate outputs.

License

MIT License - see LICENSE for details.