asciianything 1.1.1 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CREDITS.md +2 -2
  2. package/README.md +104 -13
  3. package/package.json +1 -1
package/CREDITS.md CHANGED
@@ -5,8 +5,8 @@
5
5
  **Night highway** — [Night Traffic Flow in Urban Highway View](https://www.pexels.com/video/night-traffic-flow-in-urban-highway-view-35835506/)
6
6
  by [Sururi Ballıdağ](https://www.pexels.com/@drector/) (İstanbul).
7
7
  Source file `15195617_1440_2560_30fps.mp4`, 1440 × 2560, 29.97 fps, 19.42 s.
8
- Used under the [Pexels license](https://www.pexels.com/license/). The clips in `assets/demo.mp4` and
9
- `assets/night-highway-1080p.mp4` are ASCII derivatives of it; the 1080p version is a 16:9 crop of the vertical original.
8
+ Used under the [Pexels license](https://www.pexels.com/license/). `assets/night-highway-1080p.mp4` is the
9
+ ASCII derivative of it: a 16:9 crop of the vertical original, rendered at 1920 × 1080.
10
10
 
11
11
  **Sunset** — [Stunning Beach Sunset with Vibrant Colors](https://www.pexels.com/video/stunning-beach-sunset-with-vibrant-colors-29045884/)
12
12
  by [Manoo Media](https://www.pexels.com/@manoo-media-65214113/).
package/README.md CHANGED
@@ -4,23 +4,23 @@
4
4
 
5
5
  **A video rebuilt from coloured lowercase prose. One command, every frame, at the source's own resolution and frame rate.**
6
6
 
7
+ [![Stars](https://img.shields.io/github/stars/sloemo01/asciianything?style=flat-square&color=1d1d1f&logo=github&label=stars)](https://github.com/sloemo01/asciianything/stargazers)
8
+ [![Forks](https://img.shields.io/github/forks/sloemo01/asciianything?style=flat-square&color=1d1d1f&label=forks)](https://github.com/sloemo01/asciianything/forks)
9
+ [![Watchers](https://img.shields.io/github/watchers/sloemo01/asciianything?style=flat-square&color=1d1d1f&label=watchers)](https://github.com/sloemo01/asciianything/watchers)
10
+ [![License](https://img.shields.io/github/license/sloemo01/asciianything?style=flat-square&color=1d1d1f)](LICENSE)
7
11
  [![npm](https://img.shields.io/npm/v/asciianything?style=flat-square&color=1d1d1f&logo=npm&logoColor=white)](https://www.npmjs.com/package/asciianything)
8
- [![downloads](https://img.shields.io/npm/dm/asciianything?style=flat-square&color=1d1d1f&label=downloads)](https://www.npmjs.com/package/asciianything)
9
- [![stars](https://img.shields.io/github/stars/sloemo01/asciianything?style=flat-square&color=1d1d1f&logo=github&label=stars)](https://github.com/sloemo01/asciianything/stargazers)
10
- [![license](https://img.shields.io/github/license/sloemo01/asciianything?style=flat-square&color=1d1d1f)](LICENSE)
11
12
  [![node](https://img.shields.io/badge/node-%E2%89%A518-1d1d1f?style=flat-square)](package.json)
12
13
 
13
14
  <p>
14
- <a href="assets/night-highway-1080p.mp4"><img src="https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/night-highway-1080p.jpg" width="32%" alt="Night highway in ASCII prose, 1920x1080"></a>
15
- <a href="assets/sunset-ascii.mp4"><img src="https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/sunset.jpg" width="32%" alt="Sunset in ASCII prose, 3840x2160 at 60 fps"></a>
16
- <a href="assets/demo.mp4"><img src="https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/portrait.jpg" width="32%" alt="Night highway in ASCII prose, vertical 1440x2560"></a>
15
+ <a href="assets/night-highway-1080p.mp4"><img src="https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/night-highway-1080p.jpg" width="48%" alt="Night highway in ASCII prose, 1920x1080"></a>
16
+ <a href="assets/sunset-ascii.mp4"><img src="https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/sunset.jpg" width="48%" alt="Sunset in ASCII prose, 3840x2160 at 60 fps"></a>
17
17
  </p>
18
18
 
19
- <sub><b>Night highway</b>, 19.4 s, 1920×1080 &nbsp;·&nbsp; <b>Sunset</b>, 11.6 s, 3840×2160·60 &nbsp;·&nbsp; <b>Night highway</b>, 19.4 s, 1440×2560</sub>
19
+ <sub><b>Night highway</b>, 19.4 s, 1920×1080 &nbsp;·&nbsp; <b>Sunset</b>, 11.6 s, 3840×2160·60</sub>
20
20
 
21
- <sub>Three clips rendered by this package. Click a tile for the MP4.</sub>
21
+ <sub>Two clips rendered by this package. Click a tile for the MP4.</sub>
22
22
 
23
- [**Run it**](#run-it) &nbsp;·&nbsp; [What it is](#what-it-is) &nbsp;·&nbsp; [Options](#options) &nbsp;·&nbsp; [How it works](#how-it-works) &nbsp;·&nbsp; [Verification](#verification)
23
+ [**Install it**](#install-it) &nbsp;·&nbsp; [**Run it**](#run-it) &nbsp;·&nbsp; [What is in here](#what-is-in-here) &nbsp;·&nbsp; [How it works](#how-it-works) &nbsp;·&nbsp; [Verification](#verification) &nbsp;·&nbsp; [Credits](#credits)
24
24
 
25
25
  </div>
26
26
 
@@ -46,14 +46,80 @@ A small Node CLI around a deterministic renderer.
46
46
  - **Zero disk churn.** Raw frames are piped from `ffmpeg` into the renderer and straight into `libx264`; no PNG sequence
47
47
  is ever written.
48
48
 
49
+ ## Install it
50
+
51
+ Paste this into an agent that can run shell commands. It asks where the copy should live, clones the repository, installs
52
+ the dependency, renders a test frame and reports what it measured before it renders anything for you. The published
53
+ package is the same code, so the agent can work from either.
54
+
55
+ ```text
56
+ Install asciianything here, then use it to render a video.
57
+
58
+ Repo: https://github.com/sloemo01/asciianything
59
+
60
+ 1. Ask me where the folder should go before downloading anything,
61
+ and wait for my answer. Propose ~/tools/asciianything as the default.
62
+ Do not pick a path silently.
63
+ 2. Download the whole repository, not just the README:
64
+ git clone https://github.com/sloemo01/asciianything.git "<target>"
65
+ Without git:
66
+ curl -L -o asciianything.tar.gz \
67
+ https://github.com/sloemo01/asciianything/archive/main.tar.gz
68
+ tar xzf asciianything.tar.gz && mv asciianything-main "<target>"
69
+ 3. Install and prove it:
70
+ cd "<target>" && npm ci
71
+ node src/cli.js --help
72
+ node src/cli.js assets/night-highway-1080p.mp4 --still 8 \
73
+ --font-size 10 --calibration 0.76 --halo 1.2 --halo-radius 8 \
74
+ -o /tmp/proof.png
75
+ Print the commit hash (git -C "<target>" rev-parse --short HEAD), the
76
+ grid size the CLI reports, and the size of /tmp/proof.png. If npm ci,
77
+ ffmpeg, or the still fails, say so and stop. Never describe this tool
78
+ from memory.
79
+ 4. Check the machine has ffmpeg and ffprobe on PATH; if not, tell me the
80
+ install command for my platform and stop.
81
+ 5. Report back in this order: install path and commit, the grid and glyph
82
+ settings, the encoder flags, and three rules from "How it works" with
83
+ the section each came from.
84
+ 6. Then ask me for the video to convert, and for the font size. Ask once;
85
+ do not interview me. Render it, probe the output with ffprobe, and show
86
+ me the frame count, duration and resolution next to the source's.
87
+ ```
88
+
89
+ Or skip the repository entirely:
90
+
91
+ ```bash
92
+ npx asciianything night-drive.mp4 # one clip, no install
93
+ npm i -g asciianything # or keep it on PATH
94
+ ```
95
+
96
+ Node 18+ and `ffmpeg` / `ffprobe` are the only requirements.
97
+
98
+ ### Update it
99
+
100
+ ```text
101
+ Update my asciianything install, then report what changed.
102
+
103
+ 1. Ask me for the folder before touching anything, and wait.
104
+ 2. Print the current commit, then make the update reversible:
105
+ git -C "<target>" rev-parse --short HEAD
106
+ git -C "<target>" diff > my-changes.patch
107
+ cp -R "<target>" "<target>.bak"
108
+ 3. Pull the latest main:
109
+ git -C "<target>" pull --ff-only
110
+ cd "<target>" && npm ci
111
+ 4. Diff the CLI help and the README changelog before and after, and tell
112
+ me what new flags or defaults appeared. Do not re-render anything yet.
113
+ 5. If the build or a test still fails, restore "<target>.bak" and say so.
114
+ ```
115
+
49
116
  ## Run it
50
117
 
51
118
  ```bash
52
119
  npx asciianything night-drive.mp4
53
120
  ```
54
121
 
55
- That writes `night-drive-ascii.mp4` at the source's resolution, frame rate and duration. Node 18+ and `ffmpeg` /
56
- `ffprobe` on `PATH` are the only requirements.
122
+ That writes `night-drive-ascii.mp4` at the source's resolution, frame rate and duration.
57
123
 
58
124
  ```bash
59
125
  # a specific output, larger letters
@@ -90,6 +156,28 @@ npx asciianything clip.mp4 --prose my-words.txt
90
156
  | `--limit <n>` | — | stop after n frames |
91
157
  | `--info` | — | print grid, cell size and measured coverage, then exit |
92
158
 
159
+ ## What is in here
160
+
161
+ ```text
162
+ asciianything/
163
+ src/cli.js argument parsing, ffprobe, the decode → render → encode pipe
164
+ src/render.js sampling, weight choice, coverage division, halo, composite
165
+ src/atlas.js Skia glyph rasterisation and measured ink coverage
166
+ src/prose.js sentence bank → the fixed character grid
167
+ assets/
168
+ JetBrainsMono-Variable.ttf the bundled mono, weight axis 100–800
169
+ prose.json 1,844 sentences for the night-highway clips
170
+ OFL.txt the font licence
171
+ night-highway-1080p.mp4 demo, 19.4 s, 1920×1080
172
+ sunset-ascii.mp4 demo, 11.6 s, 3840×2160·60
173
+ .github/workflows/publish.yml npm publish on release, with provenance
174
+ CREDITS.md footage and typeface sourcing
175
+ LICENSE MIT
176
+ ```
177
+
178
+ `src/` is the whole tool; everything else is either a demo or a licence. There is no build step — the CLI runs from
179
+ source.
180
+
93
181
  ## How it works
94
182
 
95
183
  **A glyph inks only part of its cell, so the colour is divided by that part.** Drawing the sampled source colour into a
@@ -118,6 +206,10 @@ sand and rock are untouched. It is off by default.
118
206
  offset, and the character grid is frozen for the whole clip. Motion in the output is the source's motion, sampled — never
119
207
  reshuffled text.
120
208
 
209
+ **One frame in, one frame out.** The decoder is asked for raw RGBA at the source's native size, the renderer writes RGB,
210
+ and the encoder is told the source's frame rate and colour tags. Frame count, duration, resolution and pixel format are
211
+ probed on both files afterwards.
212
+
121
213
  ## Verification
122
214
 
123
215
  Measured against the sources after encoding, in linear light, one-cell blur:
@@ -125,7 +217,6 @@ Measured against the sources after encoding, in linear light, one-cell blur:
125
217
  | clip | grid | whole-frame luminance | settings |
126
218
  | --- | --- | --- | --- |
127
219
  | night highway · 1920×1080 | 320 × 99 (31,680) | +2.5 % | `--font-size 10 --calibration 0.76 --halo 1.2 --halo-radius 8` |
128
- | night highway · 1440×2560 | 120 × 117 (14,040) | +0.5 … +7 % | `--font-size 20`, six sampled times |
129
220
  | sunset · 3840×2160·60 | 384 × 114 (43,776) | +0.9 % | `--font-size 17 --calibration 0.8025 --halo 1.7 --halo-radius 14` |
130
221
 
131
222
  Frame counts, durations, dimensions and colour tags are probed independently after encoding. The sunset run additionally
@@ -133,7 +224,7 @@ holds every measured region — top sky, cirrus, cloud fan, sea band, wet sand,
133
224
 
134
225
  ## Demos
135
226
 
136
- The three clips above are rendered with this package:
227
+ Both clips above are rendered with this package:
137
228
 
138
229
  ```bash
139
230
  # 1920x1080, cropped from a 1440x2560 source, 582 frames at 29.97 fps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciianything",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
4
4
  "description": "Turn any video into a mosaic of coloured lowercase prose, frame-accurate, with ffmpeg.",
5
5
  "keywords": [
6
6
  "ascii",