asciianything 1.2.2 → 1.2.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/README.md +7 -5
  2. package/package.json +1 -1
  3. package/src/cli.js +5 -1
package/README.md CHANGED
@@ -12,13 +12,13 @@
12
12
  [![node](https://img.shields.io/badge/node-%E2%89%A518-1d1d1f?style=flat-square)](package.json)
13
13
 
14
14
  <p>
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>
15
+ <a href="https://cdn.jsdelivr.net/gh/sloemo01/asciianything@main/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="https://cdn.jsdelivr.net/gh/sloemo01/asciianything@main/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
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>Two clips rendered by this package — the same command that turns a still photo into a PNG or a folder of three.js frames into a clip.</sub>
21
+ <sub>Two clips rendered by this package — the same command that turns a still photo into a PNG or a folder of three.js frames into a clip. Click a tile to play: GitHub refuses to inline video in the blob view at any size, so the tiles stream the 7–8 MB copies from <code>assets/</code> through jsDelivr. The full-quality renders use the settings in <a href="#demos">Demos</a>.</sub>
22
22
 
23
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
 
@@ -32,14 +32,16 @@ This is not an `@%#*+=-:.` brightness ramp, and it is not text laid over a pictu
32
32
  frame comes out, and the only things that change between frames are scene colour, sampled luminance, glyph weight and
33
33
  emitted colour. No zoom, pan, transition, grain or vignette is ever added.
34
34
 
35
- ![source and output, same frame](https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/sunset-comparison.jpg)
35
+ ![the source frame above, the same crop rendered in prose below, 1:1](https://raw.githubusercontent.com/sloemo01/asciianything/main/assets/sunset-comparison.jpg)
36
+
37
+ <sub><b>Top:</b> the source frame. <b>Bottom:</b> the same 880×495 crop rendered, at 1:1 — every letter readable, no downscale.</sub>
36
38
 
37
39
  ## What it converts
38
40
 
39
41
  | input | command | output |
40
42
  | --- | --- | --- |
41
43
  | video — mp4, mov, webm, gif, anything ffmpeg decodes | `asciianything clip.mp4` | `clip-ascii.mp4` |
42
- | photo — png, jpg, webp, avif, tiff, bmp | `asciianything shot.jpg` | `shot-ascii.png` |
44
+ | photo — png, jpg, webp, avif, tiff, bmp | `asciianything shot.jpg` | `shot-ascii.png` (a PNG whatever `-o` says) |
43
45
  | frame sequence — a folder of numbered PNGs | `asciianything frames/ --fps 60` | `frames-ascii.mp4` |
44
46
 
45
47
  **3D scenes.** A three.js scene is a frame sequence waiting to happen: render it to PNGs (`renderer.render()` in a loop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciianything",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Turn a 3D scene, a video or a photo into a mosaic of coloured lowercase prose \u2014 frame-accurate, with ffmpeg.",
5
5
  "keywords": [
6
6
  "ascii",
package/src/cli.js CHANGED
@@ -247,7 +247,11 @@ async function main() {
247
247
  if (isImage || values.still !== undefined) {
248
248
  const at = isImage ? 0 : Number(values.still);
249
249
  const png = await renderStill(input, at, renderer, meta);
250
- const out = values.out || `${path.basename(input, path.extname(input))}-ascii.png`;
250
+ let out = values.out || `${path.basename(input, path.extname(input))}-ascii.png`;
251
+ if (path.extname(out).toLowerCase() !== '.png') {
252
+ out = `${out.slice(0, out.length - path.extname(out).length)}.png`;
253
+ if (!quiet) console.error(`one frame: writing PNG -> ${out}`);
254
+ }
251
255
  fs.writeFileSync(out, png);
252
256
  if (!quiet) console.error(`wrote ${out}`);
253
257
  return;