asciify-engine 4.8.0 → 4.9.0
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 +7 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{model-CMKdRB30.d.ts → model-ChcdXIzJ.d.ts} +45 -2
- package/dist/{model-fP9NdG-w.d.cts → model-fv_acoD_.d.cts} +45 -2
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.cts +2 -2
- package/dist/studio.d.ts +2 -2
- package/dist/studio.js +1 -1
- package/examples/print-composition.ts +15 -0
- package/package.json +2 -1
- package/skills/asciify-engine/SKILL.md +5 -3
- package/skills/asciify-engine/references/print-styles.md +63 -0
- package/skills/asciify-engine/references/studio-workspace.md +6 -2
- package/skills/asciify-engine/references/upgrading.md +4 -0
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
name: asciify-engine
|
|
3
3
|
description: Build and tune browser ASCII images, video, GIFs, text, and interactive heroes with asciify-engine. Use for media conversion, character and color choices, hover integration, layered HTML typography, scroll-synced video, and rendering performance in apps using this package.
|
|
4
4
|
metadata:
|
|
5
|
-
tested-engine: "4.
|
|
5
|
+
tested-engine: "4.9.0"
|
|
6
6
|
updated: "2026-10-07"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Asciify Engine
|
|
10
10
|
|
|
11
|
-
Use the published `asciify-engine` npm package for browser canvas rendering. Tested against **4.
|
|
11
|
+
Use the published `asciify-engine` npm package for browser canvas rendering. Tested against **4.9.0**. Check the application's installed version and its public types before using newer options; a local checkout can contain unpublished changes.
|
|
12
12
|
|
|
13
13
|
- Agent entry: https://asciify.org/skill (redirects to this Markdown document).
|
|
14
14
|
- Playground: https://asciify.org/editor
|
|
@@ -143,7 +143,7 @@ For optional wallpaper/backdrops, alternate renderers, palettes, masks, saved lo
|
|
|
143
143
|
|
|
144
144
|
For multiple media/text layers in one live component, use 4.8+ `mountStudioProject` and read [layered-projects.md](references/layered-projects.md). It shares one playback loop and rendering budgets across up to eight independently styled layers. Persist source keys separately from media, and use `exportStudioProject` for independent exports. Do not create one mounted Studio instance per layer or rasterize accessible interface text.
|
|
145
145
|
|
|
146
|
-
Legacy `CHARSETS`, `ART_STYLE_PRESETS`, `CHARSET_SEQUENCES`, `LIVING_STYLE_PRESETS` and their key types are removed. Do not import them or generate old names such as Katakana, Binary, Waves or Smoke. Use the
|
|
146
|
+
Legacy `CHARSETS`, `ART_STYLE_PRESETS`, `CHARSET_SEQUENCES`, `LIVING_STYLE_PRESETS` and their key types are removed. Do not import them or generate old names such as Katakana, Binary, Waves or Smoke. Use the 24 `STUDIO_STYLES` for render-style selectors and `/studio` rendering. For ASCII-only character ramps use `CHARACTER_SETS` from `/core` or `STUDIO_CHARACTER_SETS` from `/studio`; custom Unicode and user-provided frame arrays remain supported. Core `artStyle` only accepts `classic`; use explicit options instead of preset shortcuts. Despite the requested 4.1.0 version number, migrating these removed APIs is a breaking change.
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
## Fine dither and creative controls (4.2)
|
|
@@ -155,3 +155,5 @@ From 4.5, `dither.algorithm: 'blue-noise'` uses a precomputed dispersed threshol
|
|
|
155
155
|
From 4.6, Studio adds `color.curves` (RGB, red, green, blue) and optional edge-preserving `color.denoise`. `player.settings` returns a detached snapshot for saving or exporting after updates. Read [channel curves and source noise](references/studio-workspace.md#channel-curves-and-source-noise-46) for point limits, update semantics and the processing budget. Do not turn noise reduction on by default or apply it again to the already-rendered characters.
|
|
156
156
|
|
|
157
157
|
From 4.7, Studio supports up to eight ordered source warps: Twirl, Pinch, Spherize, Ripple, Zigzag, Shear, Smudge, Polar and Fragment. Build controls from `STUDIO_WARPS`, retain array order, and read [source shaping](references/source-shaping.md) for bounds, alpha/edge policy and cached-map performance. These shape the source; use `motion.type` to bring a still image to life and `hover.effect` for pointer interaction. Keep them independent, with an empty warp stack by default.
|
|
158
|
+
|
|
159
|
+
From 4.9, optional Studio adds Stipple, Engraving, Crosshatch, Woodblock, Risograph and Pointillism with a shared `print` settings group. Read [print and illustration](references/print-styles.md) for exact controls, light-ink versus dark-ink polarity, still-motion integration and dense-render limits. These are genuine additional render paths; do not substitute dither presets for their IDs.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Print and illustration (4.9)
|
|
2
|
+
|
|
3
|
+
Six local Canvas renderers live in the optional `asciify-engine/studio` entry. They do not change the default ASCII style or add a server/provider. They share source grading, curves, warps, masks, hover, still-image motion, finishing, saved settings, single-image export and layered projects.
|
|
4
|
+
|
|
5
|
+
| Style ID | Mechanism | Useful controls |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `stipple` | Four spatially jittered dots per sample; tone changes their area | Coverage, weight, texture, seed |
|
|
8
|
+
| `engraving` | Parallel world-anchored cuts with tone-dependent width | Coverage, weight, angle, texture |
|
|
9
|
+
| `crosshatch` | Up to three crossing screens appear across the tonal range | Coverage, weight, angle, texture |
|
|
10
|
+
| `woodblock` | Five tone steps in broad carved bands with correlated irregular edges | Coverage, weight, angle, texture |
|
|
11
|
+
| `risograph` | Two overlapping ink-dot screens; source warmth separates coverage in source-color mode | Second ink, registration offset/direction, texture |
|
|
12
|
+
| `pointillism` | Four small elliptical pigment strokes per sample | Source color, weight, texture, seed |
|
|
13
|
+
|
|
14
|
+
`STUDIO_PRINT_STYLES` supplies `value`, `label`, and `description` for selectors. `isStudioPrintStyle(style)` identifies this family. The full `STUDIO_STYLES` catalog has 24 styles. Existing `riso` and `print` look IDs remain dither presets; choose `style: 'risograph'` to use the new two-screen renderer. These are print-inspired raster treatments, not physical ink simulation, CMYK separations or vector paths.
|
|
15
|
+
|
|
16
|
+
## Live still image
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { mountStudio } from 'asciify-engine/studio';
|
|
20
|
+
|
|
21
|
+
const player = await mountStudio(canvas, '/your-image.jpg', {
|
|
22
|
+
settings: {
|
|
23
|
+
style: 'engraving', cellSize: 7, colorMode: 'accent', ink: '#becbbe',
|
|
24
|
+
print: { angle: -35, weight: 1.1, roughness: .3 },
|
|
25
|
+
backdrop: { color: '#101810' },
|
|
26
|
+
motion: { type: 'sheen', speed: .5, amount: .4 },
|
|
27
|
+
hover: { effect: 'water', radius: .4, strength: .5 },
|
|
28
|
+
},
|
|
29
|
+
maxDimension: 960, maxCells: 12000,
|
|
30
|
+
onError: console.error,
|
|
31
|
+
});
|
|
32
|
+
player.update({ print: { angle: 20 } }); // retains the other print settings
|
|
33
|
+
const settings = player.settings; // detached snapshot for saving/export
|
|
34
|
+
// On unmount:
|
|
35
|
+
player.destroy();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For dark ink on paper, use `print.invert: true`, a dark `ink`, and a light `backdrop.color`. Inversion chooses which source tones receive ink; it does not change the ink or backdrop automatically. Dissolve reduces ink in either polarity. Trail still inverts the local tonal response. The motion engine retains its own `12 / speed` cycle; the print texture has no independent time source.
|
|
39
|
+
|
|
40
|
+
## Exact settings
|
|
41
|
+
|
|
42
|
+
`print` is an optional nested group in `StudioInput` and saved version-1 `StudioSettings`. Old files receive compatible defaults. Partial updates merge this group. `normalizeStudioPrint`, `DEFAULT_STUDIO_PRINT`, and `StudioPrintSettings` are exported from `/studio`.
|
|
43
|
+
|
|
44
|
+
| Field | Range / default | Meaning |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `density` | 0–2 / 1 | Tonal coverage; zero draws no print marks |
|
|
47
|
+
| `weight` | .25–2 / 1 | Dot/stroke size; size is bounded within the screen |
|
|
48
|
+
| `angle` | −180–180° / −35 | Line angle for engraving/crosshatch/woodblock; registration direction for risograph |
|
|
49
|
+
| `roughness` | 0–1 / .35 | Spatial texture variation; not random animation |
|
|
50
|
+
| `invert` | boolean / false | False draws highlights; true draws shadows |
|
|
51
|
+
| `secondaryInk` | six-digit hex / `#ec6752` | Second risograph ink only |
|
|
52
|
+
| `registration` | 0–1 / .2 | Risograph offset, up to .38 of one cell |
|
|
53
|
+
| `seed` | integer 0–65535 / 7 | Repeatable spatial texture |
|
|
54
|
+
|
|
55
|
+
All print styles use square sampling cells. `cellSize` accepts 1–60 in the reference frame; `studioGrid` still reports any effective budget limit. It is independent of `dither.scale`. Source color and gray modes remain available. Only Pointillism's source-color mode separates pigment hues; accent mode retains the chosen ink. Risograph mixes its two screens on transparent artwork with multiply, then composes that artwork over the chosen backdrop.
|
|
56
|
+
|
|
57
|
+
## Work and quality limits
|
|
58
|
+
|
|
59
|
+
Compiled screen directions and texture buffers are reused. No per-cell canvas, save/rotate/clip, or new simulation loop is created. A stable still caches the complete composition. Spatial texture uses a deterministic seed and bounded lookup; source tone changes can still change coverage. Woodblock intentionally has stepped tones. Do not label it smooth continuous shading.
|
|
60
|
+
|
|
61
|
+
Dense live print rendering costs more than the sample count alone: Pointillism draws four strokes per cell, Crosshatch up to three screens, and Woodblock emits carved polygons. Start with 12,000 cells, retain adaptive quality for motion, and measure the real device. High-resolution still exports can use a larger explicit budget. Keep the same reference pixel ratio/grid for preview and export.
|
|
62
|
+
|
|
63
|
+
The regression suite checks geometry, normalization, scaling, deterministic texture, composition caching and every hover/motion path. CPU geometry timings exclude actual Canvas drawing, decoding, GPU work and browser frame pacing. Visual output, browser export and mobile frame-rate acceptance are still unverified; do not claim competitor parity or guaranteed FPS from these tests.
|
|
@@ -25,7 +25,7 @@ await studio.seek(1.5);
|
|
|
25
25
|
studio.destroy();
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Keep complete settings in application state. Apply edits with `updateStudioSettings(settings, patch)` and pass that state to `studio.update`; the mounted instance
|
|
28
|
+
Keep complete settings in application state. Apply edits with `updateStudioSettings(settings, patch)` and pass that state to `studio.update`; from 4.6 the mounted instance also exposes a detached `settings` snapshot. Serialize that snapshot or your application state when saving a look.
|
|
29
29
|
|
|
30
30
|
In React, create the AbortController inside the effect. On cleanup, abort and destroy the returned instance; if setup resolves after disposal, immediately destroy that instance. Do not remount for slider changes: call `update`. The mount owns its loaded media. `mountStudioMedia` takes ownership of an already loaded `StudioMedia`. Use an independent media instance for export.
|
|
31
31
|
|
|
@@ -190,7 +190,7 @@ Example: `player.update({ motion: { type: 'trace', speed: 1, amount: .7 }, hover
|
|
|
190
190
|
|
|
191
191
|
Use `color.gamma` to lift midtones (above 1) or deepen them (below 1), from 0.25 to 4. `color.shadows` and `color.highlights` range from −1 to 1; positive lifts that region, negative darkens it. They form a monotone curve with fixed black, middle and white anchors. This is a bounded tonal curve, not a freely editable per-channel curve graph. It cannot recover clipped source detail.
|
|
192
192
|
|
|
193
|
-
`color.blackPoint` (0–0.99, default 0) and `color.whitePoint` (default 1) map the input range before gamma. White is normalized to at least 1/255 above black. These controls apply equally to all
|
|
193
|
+
`color.blackPoint` (0–0.99, default 0) and `color.whitePoint` (default 1) map the input range before gamma. White is normalized to at least 1/255 above black. These controls apply equally to all Studio renderers before dither/character conversion, preserve source alpha, and round-trip in settings. Neutral settings skip the transform. The 256-entry lookup is rebuilt on configuration changes and reused for source frames. Reset with `{ blackPoint: 0, whitePoint: 1, gamma: 1, shadows: 0, highlights: 0 }`.
|
|
194
194
|
|
|
195
195
|
`blue-noise` uses a deterministic 64×64 toroidal rank tile generated offline with void-and-cluster relaxation. It suppresses low-frequency clumping; it is not white noise with a different label. A palette-pair projection controls coverage, preserving flat grayscale means for a black/white palette at full strength. Arbitrary color palettes still approximate the source. The original palette uses web-safe channel quantization. The rank tile is 8 KiB in memory, loads only with `/studio`, and has no network request or runtime generator.
|
|
196
196
|
|
|
@@ -243,3 +243,7 @@ const saved = serializeStudioSettings(player.settings);
|
|
|
243
243
|
## Ordered source shaping (4.7)
|
|
244
244
|
|
|
245
245
|
`warps` stores up to eight optional transforms applied in array order before all styles. `warpEdge` selects extended or transparent edges. Read [source shaping](source-shaping.md) for the nine mechanisms, controls, normalization, editor construction and dense-video cost. This is separate from art-style selection, pointer response and autonomous motion. The default stack is empty.
|
|
246
|
+
|
|
247
|
+
## Print and illustration (4.9)
|
|
248
|
+
|
|
249
|
+
The catalog adds six print treatments with fine square cells and an optional `print` settings group. See [print-styles.md](print-styles.md) for the mechanisms, controls, polarity, bounded rendering and living-image example. They use the same Studio pipeline, saved settings and exports.
|
|
@@ -77,3 +77,7 @@ Adds optional Studio `warps` and `warpEdge` with an empty default stack. Nine tr
|
|
|
77
77
|
### 4.8 layered projects
|
|
78
78
|
|
|
79
79
|
Adds `mountStudioProject`, `mountStudioProjectMedia`, `createStudioProjectRenderer`, `exportStudioProject` and the typed project model in optional `/studio`. Up to eight independently styled media/text layers share a playback loop and cell/raster budgets. Existing single-source APIs/defaults remain. Layered project JSON uses a distinct `kind` and source keys; it is not interchangeable with single-source settings JSON and does not contain media. See [layered-projects.md](layered-projects.md) for ownership, pointer routing, export consistency and migration choices. Refresh this skill separately from npm; do not migrate simple heroes unnecessarily.
|
|
80
|
+
|
|
81
|
+
## 4.9 print rendering
|
|
82
|
+
|
|
83
|
+
Six additional `STUDIO_STYLES` use optional `print` settings. Existing v1 settings remain valid and ASCII defaults stay unchanged. The print group merges on partial updates. Import the shared catalog and read [print-styles.md](print-styles.md); offer print-specific controls only for those styles. Existing `print` and `riso` look IDs retain their dither behavior. Refresh the npm dependency and installed skill separately.
|