🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@resciencelab/dither-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@resciencelab/dither-cli

Agent-native image dithering CLI — powered by dithermark's algorithms

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
11
450%
Maintainers
1
Weekly downloads
 
Created
Source

@resciencelab/dither-cli

Agent-native image and video dithering from the terminal — powered by dithermark's algorithms.

Sub-second per image. No browser, no Playwright, no WebGL. Pure Node.

Install

npm i -g @resciencelab/dither-cli

Quick start

# One-shot with preset
dither apply photo.jpg -o out.png --preset gameboy

# Custom algorithm + palette + filters
dither apply photo.jpg -o out.png \
  --mode color \
  --algorithm atkinson \
  --palette ocean \
  --colors 8 \
  --color-comparison oklab \
  --brightness 110 \
  --contrast 120

# Black & white dithering
dither apply photo.jpg -o out.png --mode bw --algorithm floyd-steinberg

# Batch a folder in parallel
dither batch "shots/*.jpg" -o dithered/ --preset newsprint --concurrency 4

# Video (requires ffmpeg)
dither video in.mp4 -o out.mp4 --preset comic-book --fps 24

Showcase: 20 looks from one frame

Source image: 2001太空漫游-旋转空间站.png

Source

Source rotating station

20-result contact sheet

20 result contact sheet

Example recipes

#OutputRecipe
0101--preset gameboy
0202--preset mac-classic
0303--preset c64
0404--preset newsprint
0505--preset risograph
0606--preset neon
0707--mode color --algorithm ordered--bayer-16 --colors 2 --custom-colors "#0047ab,#ffffff" --color-comparison cie-lab
0808--mode color --algorithm ordered--bayer-8--hl --palette sepia --colors 6 --color-comparison hue-lightness --contrast 118
0909--mode color --algorithm ordered--blueNoise-16--stark --palette ocean --colors 8 --color-comparison oklab --saturation 110
1010--mode color --algorithm stucki --palette wildberry --colors 12 --color-comparison cie-lab --contrast 112 --brightness 104
1111--mode color --algorithm xor--medium --palette mondrianchromatic --colors 8 --color-comparison rgb
1212--mode color --algorithm simplex --palette galaxy --colors 10 --color-comparison oklab-taxi --hue-rotation 18
1313--mode bw --algorithm ordered--hatchHorizontal-4 --black-color "#111111" --white-color "#f5f1e8" --contrast 130
1414--mode bw --algorithm adaptive-threshold --black-color "#0b1d51" --white-color "#ffffff" --blur-before 0.5 --sharpen-after 1.1
1515--mode bw --algorithm ordered--bayer-8 --black-color "#332211" --white-color "#fff4d6" --brightness 108 --contrast 122
1616--mode bw --algorithm atkinson --black-color "#1a1a1a" --white-color "#fdfbf5" --sharpen-before 1.2
1717--mode color --algorithm ordered--bayer-2 --custom-colors "#000000,#0000d7,#d70000,#d700d7,#00d700,#00d7d7,#d7d700,#d7d7d7" --colors 8 --color-comparison hue --saturation 125
1818--mode color --algorithm floyd-steinberg --custom-colors "#1b1f3b,#f7f3e9,#d7263d,#1b998b" --colors 4 --color-comparison cie-lab --contrast 120
1919--mode color --algorithm ordered--dot-8--hl --palette lilac --colors 6 --color-comparison weighted-hsl --blur-before 0.8 --blur-after 0.3
2020--mode color --algorithm burkes --custom-colors "#0d1b2a,#415a77,#e0e1dd,#c1121f,#ffd166" --colors 5 --color-comparison cie-xyz --sharpen-before 1.8 --contrast 125

Presets

10 curated presets covering classic dither aesthetics:

PresetModeDescription
gameboycolorClassic Game Boy green palette, Bayer 4x4
mac-classicbwMacintosh classic 1-bit, Atkinson dithering
c64colorCommodore 64 palette, Floyd-Steinberg
gameboy-pocketcolorGame Boy Pocket grayscale, Bayer 8x8
comic-bookcolorHalftone dots with limited palette
newsprintbwBlack & white halftone newspaper
zx-spectrumcolorZX Spectrum 8-color palette, Bayer 2x2
risographcolorRisograph 3-color spot print look
thermal-printbwThermal receipt printer, horizontal hatch
neoncolorVibrant neon palette, Floyd-Steinberg
dither preset list              # list all presets
dither preset inspect gameboy   # show preset details

Algorithms

30+ dither algorithms across BW and color modes:

  • Error diffusion: Floyd-Steinberg, Atkinson, Stucki, Burkes, Sierra 1/2/3, Reduced Atkinson
  • Ordered: Bayer 2x2/4x4/8x8/16x16, Halftone, Dot patterns
  • Other: Threshold, Random, Closest Color
dither info algorithms          # list all algorithms
dither info algorithms --bw     # BW only
dither info algorithms --color  # color only

Palettes

31 built-in color palettes:

dither info palettes            # list all palettes
dither palette preview sepia    # ASCII preview
dither palette export sepia --format json  # export as JSON

Color comparison

4 color comparison methods for finding closest palette matches:

MethodDescription
rgbEuclidean RGB distance (default)
lumaWeighted luma-aware distance
lightnessHSL lightness comparison
oklabPerceptual OKLab distance (best quality)

Filters

Apply pre-dither image adjustments:

dither apply photo.jpg -o out.png --preset gameboy \
  --brightness 110 \
  --contrast 120 \
  --saturation 80 \
  --pixelate 2

Config files

Save your recipe as JSON and reuse it:

{
  "name": "my-recipe",
  "mode": "color",
  "algorithm": "atkinson",
  "palette": "ocean",
  "colors": 8,
  "colorComparison": "oklab",
  "filters": {
    "brightness": 110,
    "contrast": 120,
    "saturation": 100,
    "pixelate": 1
  }
}
dither apply photo.jpg -o out.png --config my-recipe.json

Video

Requires ffmpeg on PATH. Decomposes video into frames, dithers each in parallel, recomposes.

dither video in.mp4 -o out.mp4 --preset mac-classic --fps 24 --concurrency 4

License

MIT

Keywords

dither

FAQs

Package last updated on 18 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts