asciify-engine 1.0.103 → 1.0.104

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/README.md CHANGED
@@ -213,7 +213,7 @@ await asciifyVideo('/hero.mp4', canvas, {
213
213
  fitTo: '#hero',
214
214
  objectFit: 'contain',
215
215
  objectPosition: 'center bottom',
216
- width: '100vw',
216
+ width: '100%',
217
217
  height: '100%',
218
218
  options: {
219
219
  sourceCrop: { top: 0.1, bottom: 0.18 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciify-engine",
3
- "version": "1.0.103",
3
+ "version": "1.0.104",
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.102`
11
+ **Current version:** `1.0.104`
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.102
39
+ npm install asciify-engine@1.0.104
40
40
  ```
41
41
 
42
42
  ## Mental Model
@@ -64,7 +64,7 @@ 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. Prefer CSS-like insets for readable framing; the engine preserves source proportions by default and auto-crops the opposite axis:
67
+ Use `options.sourceCrop` when the source media has empty edges or needs tighter framing. Percent values are normalized `0–1` by default. Prefer CSS-like insets for readable framing; side insets define the crop window directly, and `asciifyVideo` sizes from that crop aspect so it does not stretch:
68
68
 
69
69
  ```ts
70
70
  options: {
@@ -88,7 +88,7 @@ options: {
88
88
  }
89
89
  ```
90
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.
91
+ For centered crops, `sourceCrop: { height: 0.7 }` keeps 70% of the source and preserves the original source aspect. `preserveAspect` is only for single-dimension `width`/`height` crops; do not use it to force hero bands. For wide heroes, crop with `top`/`bottom` and let the engine derive the cropped aspect. `sourceCrop` is opt-in; when omitted, the engine samples the full source exactly as older versions did.
92
92
 
93
93
  Use top-level `asciifyVideo` layout options when the destination needs full-bleed framing. These affect the visible canvas only, not the sampled media:
94
94
 
@@ -109,6 +109,7 @@ await asciifyVideo('/hero.mp4', canvas, {
109
109
  Mental split:
110
110
 
111
111
  - `sourceCrop` chooses the source window before ASCII conversion.
112
+ - CSS-like insets change the crop aspect naturally; the engine keeps ASCII proportions intact.
112
113
  - `objectFit`, `objectPosition`, `scale`, `width`, and `height` place the rendered canvas in the page.
113
114
  - Use `objectFit: 'cover'` for full-width/full-bleed heroes.
114
115
  - Use `objectFit: 'contain'` for previews where the whole source should remain visible.
@@ -163,19 +164,21 @@ Recommended starting point:
163
164
  ```ts
164
165
  {
165
166
  fitTo: hero,
166
- objectFit: 'cover',
167
+ objectFit: 'contain',
167
168
  objectPosition: 'center bottom',
168
169
  width: '100%',
169
170
  height: '100%',
170
171
  fontSize: 5,
171
172
  fps: 60,
172
173
  maxRenderDimension: 1280,
174
+ maxCachedFrames: 96,
173
175
  artStyle: 'classic',
174
176
  options: {
175
177
  charset: CHARSETS.dense,
176
178
  colorMode: 'accent',
177
179
  accentColor: '#e8d7b7',
178
180
  normalize: true,
181
+ sourceCrop: { top: 0.08, bottom: 0.16 },
179
182
  animationStyle: 'none',
180
183
  hoverStrength: 0,
181
184
  }
@@ -206,6 +209,7 @@ Start with:
206
209
  charset: CHARSETS.dense,
207
210
  colorMode: 'fullcolor',
208
211
  normalize: true,
212
+ sourceCrop: { top: 0.08, bottom: 0.16 },
209
213
  animationStyle: 'none',
210
214
  hoverStrength: 0,
211
215
  }