asciify-engine 1.0.97 → 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/README.md CHANGED
@@ -175,7 +175,23 @@ await asciifyVideo('/hero.mp4', canvas, {
175
175
  });
176
176
  ```
177
177
 
178
- `sourceCrop: { height: 0.7 }` keeps 70% of the source centered. Use `preserveAspect: false` only for exact manual source windows.
178
+ Crop from the sides the same way:
179
+
180
+ ```ts
181
+ await asciifyVideo('/hero.mp4', canvas, {
182
+ options: {
183
+ sourceCrop: { left: 0.1, right: 0.1 },
184
+ },
185
+ });
186
+ ```
187
+
188
+ Use any side together:
189
+
190
+ ```ts
191
+ sourceCrop: { top: 0.08, right: 0.12, bottom: 0.22, left: 0.12 }
192
+ ```
193
+
194
+ `sourceCrop: { height: 0.7 }` keeps 70% of the source centered. Because `preserveAspect` defaults to `true`, the engine may also crop the opposite axis automatically to avoid stretching. Use `preserveAspect: false` only for exact manual source windows.
179
195
 
180
196
  ### Chroma Key (Green/Blue Screen)
181
197
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciify-engine",
3
- "version": "1.0.97",
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.97`
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.97
39
+ npm install asciify-engine@1.0.98
40
40
  ```
41
41
 
42
42
  ## Mental Model
@@ -72,6 +72,22 @@ options: {
72
72
  }
73
73
  ```
74
74
 
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
+
75
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
@@ -228,8 +244,9 @@ await asciifyVideo(video, canvas, {
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