@bitbonsai/crtify
v0.1.2
Published
Convert images to CRT phosphor terminal aesthetic
Maintainers
Readme
Examples
Install
bun i -g @bitbonsai/crtifyCLI
# Single file
crtify photo.jpg
# Batch with glob
crtify "images/*.png" --outdir output/
# Pick a phosphor preset
crtify photo.jpg --preset amber
# Watch mode
crtify photo.jpg --watchOutput files are saved as <name>-crt.webp alongside the original (or in --outdir).
Options
--preset <name> Phosphor preset: green (default), amber, white
--scanlines <0-1> Scanline opacity (default: 0.3)
--spacing <n> Scanline spacing in px, scales with resolution (default: 3)
--bloom <0-1> Bloom/glow strength (default: 0.3)
--vignette <0-1> Vignette strength (default: 1)
--noise <0-1> Noise amount (default: 0.09)
--brightness <n> Brightness multiplier (default: 0.84)
--contrast <n> Contrast multiplier (default: 1.4)
--phosphor <0-1> Phosphor subpixel detail (default: 0, off)
--green <hex> Primary phosphor color (default: #33ff33)
--outdir <dir> Output directory for batch mode
--watch Re-process on file changeAPI
import { crtify, crtifyFile } from "@bitbonsai/crtify";
// Buffer in, Buffer out
const webpBuffer = await crtify("photo.jpg", {
preset: "green",
});
// File to file
await crtifyFile("photo.jpg", "output.webp", {
preset: "amber",
scanlineOpacity: 0.5,
phosphorDetail: 0.2,
});Presets
| Preset | Color |
|--------|-------|
| green | Classic green phosphor (#33ff33) |
| amber | Warm amber terminal (#ffb000) |
| white | Monochrome white (#e0e0e0) |
How it works
- Convert to greyscale, apply brightness/contrast
- Map luminance through a gamma-corrected phosphor color LUT
- Add bloom (blurred screen layer, screen-blended)
- Overlay dual scanline layers with drift and jitter (exclusion blend)
- Apply vignette darkening toward edges
- Add film grain noise (soft-light blend)
- Optionally apply RGB phosphor subpixel triads
Scanline spacing scales automatically with image resolution so the effect looks consistent across sizes.
Requirements
License
MIT
