asciify-engine 1.0.96 → 1.0.98

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciify-engine",
3
- "version": "1.0.96",
3
+ "version": "1.0.98",
4
4
  "description": "Framework-agnostic ASCII art engine. Convert images, videos, and GIFs into ASCII art rendered on canvas.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -8,7 +8,7 @@ description: Convert images, videos, GIFs, webcam streams, text, and animated ba
8
8
  Use this skill for the `asciify-engine` npm package.
9
9
 
10
10
  **Package:** `asciify-engine`
11
- **Current version:** `1.0.96`
11
+ **Current version:** `1.0.98`
12
12
  **Playground:** https://asciify.org
13
13
  **GitHub:** https://github.com/ayangabryl/asciify-engine
14
14
 
@@ -36,7 +36,7 @@ npm install asciify-engine
36
36
  For existing apps, install the latest tested version:
37
37
 
38
38
  ```bash
39
- npm install asciify-engine@1.0.96
39
+ npm install asciify-engine@1.0.98
40
40
  ```
41
41
 
42
42
  ## Mental Model
@@ -64,15 +64,31 @@ Use legacy object frames only when you need per-cell mutation, dots mode, heavy
64
64
  - `gifToAsciiFrames()`
65
65
  - `renderFrameToCanvas()`
66
66
 
67
- Use `options.sourceCrop` when the source media has empty edges or needs tighter framing without changing the destination canvas size. Percent values are normalized `0–1` by default. Passing only `height` or only `width` preserves source proportions and centers the crop:
67
+ Use `options.sourceCrop` when the source media has empty edges or needs tighter framing without changing the destination canvas size. Percent values are normalized `0–1` by default. Prefer CSS-like insets for readable framing; the engine preserves source proportions by default and auto-crops the opposite axis:
68
68
 
69
69
  ```ts
70
70
  options: {
71
- sourceCrop: { height: 0.7 },
71
+ sourceCrop: { top: 0.08, bottom: 0.22 },
72
72
  }
73
73
  ```
74
74
 
75
- Set `x`, `y`, `width`, and `height` together only when manual framing is needed. `sourceCrop` is opt-in; when omitted, the engine samples the full source exactly as older versions did.
75
+ Crop from the sides the same way:
76
+
77
+ ```ts
78
+ options: {
79
+ sourceCrop: { left: 0.1, right: 0.1 },
80
+ }
81
+ ```
82
+
83
+ Use any side together:
84
+
85
+ ```ts
86
+ options: {
87
+ sourceCrop: { top: 0.08, right: 0.12, bottom: 0.22, left: 0.12 },
88
+ }
89
+ ```
90
+
91
+ For centered crops, `sourceCrop: { height: 0.7 }` keeps 70% of the source and crops equally from top/bottom plus left/right as needed. Set `preserveAspect: false` only when an exact source window is more important than avoiding stretch. `sourceCrop` is opt-in; when omitted, the engine samples the full source exactly as older versions did.
76
92
 
77
93
  ## Visual Target
78
94
 
@@ -221,15 +237,16 @@ await asciifyVideo(video, canvas, {
221
237
  fitTo: hero,
222
238
  options: {
223
239
  chromaKey: true,
224
- sourceCrop: { height: 0.7 },
240
+ sourceCrop: { top: 0.08, bottom: 0.22 },
225
241
  },
226
242
  });
227
243
  ```
228
244
 
229
245
  - `sourceCrop` happens before ASCII sampling, so the subject is reframed without changing the canvas box.
230
246
  - Default unit is `'percent'`; use values from `0` to `1`.
247
+ - Use `top`, `right`, `bottom`, and `left` for CSS-like side crops.
231
248
  - Use `{ unit: 'pixel', x, y, width, height }` for exact media-pixel crops.
232
- - Keep the crop aspect ratio close to the output aspect ratio when you want zero perceived stretching.
249
+ - Keep `preserveAspect` enabled unless you intentionally want an exact source window that can stretch.
233
250
  - For hero videos, crop the source first, then use small layout overlap only if the next section needs to tuck closer.
234
251
 
235
252
  ### Scroll-Scrub Performance Model