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

textmode.accurate.js

v1.0.1

Published

Accurate media conversion plugin for textmode.js

Readme

textmode.accurate.js

textmode.accurate.js is an add-on library for textmode.js that restores an accurate, multi-sample glyph matching conversion mode. It registers a new accurate conversion strategy next to the built-in brightness mode, making image, video, and texture sources choose glyphs from sampled cell shape instead of average brightness alone.

[!WARNING]
The accurate conversion mode is more computationally expensive than the default brightness mode. It may not be suitable for all use cases, especially on lower-end devices.

Features

  • Add an accurate conversion mode through the standard textmode.js plugin system
  • Match glyph silhouettes against a sampled source-cell mask for higher fidelity conversion
  • Preserve sampled foreground and background color behavior from the core conversion pipeline
  • Support ESM and UMD consumers with the same AccurateConversionPlugin export
  • Integrate with existing TextmodeSource.conversionMode() calls

Installation

Prerequisites

To get started with textmode.accurate.js, you'll need:

  • textmode.js 0.13.0 or newer
  • A modern browser with WebGL2 support
  • Node.js 20.8.1+ and npm for ESM installation

UMD

To use textmode.accurate.js in a browser without a bundler, load the UMD builds for both textmode.js and this add-on. textmode.js must be loaded first so the accurate conversion add-on can attach to the expected global runtime.

<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>textmode.accurate.js sketch</title>

		<script src="https://cdn.jsdelivr.net/npm/textmode.js@latest/dist/textmode.umd.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/textmode.accurate.js@latest/dist/textmode.accurate.umd.js"></script>
	</head>
	<body>
		<script src="./sketch.js"></script>
	</body>
</html>
const t = textmode.create({
	width: window.innerWidth,
	height: window.innerHeight,
	fontSize: 8,
	plugins: [AccurateConversionPlugin],
});

t.setup(async () => {
	const image = await t.loadImage('photo.jpg');
	image.conversionMode('accurate');
});

The UMD bundle exposes AccurateConversionPlugin globally.

ESM

Install the core library and the accurate conversion add-on together:

npm install textmode.js textmode.accurate.js

Then import both packages in your sketch or application code:

import { textmode } from 'textmode.js';
import { AccurateConversionPlugin } from 'textmode.accurate.js';

Plugin setup

import { textmode } from 'textmode.js';
import { AccurateConversionPlugin } from 'textmode.accurate.js';

const t = textmode.create({
	width: 800,
	height: 600,
	fontSize: 8,
	plugins: [AccurateConversionPlugin],
});

The plugin registers the accurate conversion strategy during setup and unregisters it again if the plugin is uninstalled.

Accurate conversion mode

Use conversionMode('accurate') on any compatible source after the plugin is installed:

t.setup(async () => {
	const video = await t.loadVideo('clip.mp4');

	video.play();
	video.loop();
	video.conversionMode('accurate');
	video.charColorMode('sampled');
	video.cellColorMode('sampled');
});

t.draw(() => {
	t.background(0);
	t.image(video);
});

The built-in brightness mode chooses glyphs from average luminance. The accurate mode samples each cell in a grid, compares candidate glyph masks against the source-cell shape, and keeps the closest glyph match.

Documentation

License

textmode.accurate.js is licensed under the MIT License.