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 +1 -1
- package/package.json +1 -1
- package/skills/asciify-engine/SKILL.md +9 -5
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
|
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
|
|
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: '
|
|
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
|
}
|