asciify-engine 1.0.28 → 1.0.30

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.
Files changed (2) hide show
  1. package/README.md +56 -41
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,20 +1,26 @@
1
1
  # asciify-engine
2
2
 
3
- Framework-agnostic ASCII art engine. Convert images, videos, and GIFs into ASCII art rendered on HTML canvas — plus 10 animated ASCII background effects.
3
+ <p align="left">
4
+ <a href="https://www.npmjs.com/package/asciify-engine"><img src="https://img.shields.io/npm/v/asciify-engine?color=d4ff00&labelColor=0a0a0a&style=flat-square" alt="npm version" /></a>
5
+ <a href="https://www.npmjs.com/package/asciify-engine"><img src="https://img.shields.io/npm/dm/asciify-engine?color=d4ff00&labelColor=0a0a0a&style=flat-square" alt="downloads" /></a>
6
+ <a href="https://github.com/ayangabryl/asciify/blob/main/packages/asciify-engine/LICENSE"><img src="https://img.shields.io/badge/license-MIT-d4ff00?labelColor=0a0a0a&style=flat-square" alt="MIT license" /></a>
7
+ <a href="https://www.buymeacoffee.com/asciify"><img src="https://img.shields.io/badge/buy_me_a_coffee-support-d4ff00?labelColor=0a0a0a&style=flat-square" alt="Buy Me A Coffee" /></a>
8
+ </p>
9
+
10
+ > Convert images, videos, and GIFs into ASCII art on HTML canvas. 13 art styles, 4 color modes, 10 animated backgrounds, interactive hover effects — zero dependencies.
11
+
12
+ **[▶ Live Playground](https://asciify.org) · [npm](https://www.npmjs.com/package/asciify-engine) · [Support the project ☕](https://www.buymeacoffee.com/asciify)**
4
13
 
5
14
  ## Features
6
15
 
7
- - **Image → ASCII** — single-frame conversion
8
- - **Video ASCII** — extract frames from `<video>` elements
9
- - **GIF ASCII** — parse and convert animated GIFs
10
- - **Canvas rendering** — render ASCII frames to any `<canvas>`
11
- - **6 art styles** — Classic, Particles, Letters, Box Drawing, Dense Art, Terminal
12
- - **Color modes** — Grayscale, Full Color, Matrix, Accent
13
- - **Hover effects** — Spotlight, Magnify, Repel, Glow, Color Shift
16
+ - **Media → ASCII** — images, videos, and animated GIFs
17
+ - **13 art styles** — Standard, Blocks, Circles, Braille, Katakana, Dense, and more
18
+ - **4 color modes** — Grayscale, Full Color, Matrix, Accent
14
19
  - **10 animated backgrounds** — Wave, Rain, Stars, Pulse, Noise, Grid, Aurora, Silk, Void, Morph
15
- - **Light & dark mode** — all backgrounds adapt via `lightMode` option or `colorScheme: 'auto'`
16
- - **Embed code generation** — self-contained HTML output
17
- - **Zero framework dependencies** — works with React, Angular, Vue, Svelte, vanilla JS
20
+ - **Interactive hover effects** — Spotlight, Flashlight, Magnifier, Force Field, Neon, Fire, Ice, Gravity, Shatter, Ghost
21
+ - **Light & dark mode** — via `colorScheme: 'auto'` or explicit `light` / `dark`
22
+ - **Embed generation** — self-contained HTML output (static or animated)
23
+ - **Zero dependencies** — works with React, Vue, Angular, Svelte, Next.js, or vanilla JS
18
24
 
19
25
  ## Install
20
26
 
@@ -236,43 +242,52 @@ setInterval(() => {
236
242
  }, 1000 / fps);
237
243
  ```
238
244
 
239
- ## API
245
+ ## API Reference
240
246
 
241
247
  ### Core Functions
242
248
 
243
- | Function | Description |
244
- |---|---|
245
- | `imageToAsciiFrame(source, options, targetWidth?, targetHeight?)` | Convert an image/video/canvas to a single ASCII frame; returns `{ frame, cols, rows }` |
246
- | `renderFrameToCanvas(ctx, frame, options, width, height, time?, hoverPos?)` | Render an ASCII frame onto a canvas context |
247
- | `gifToAsciiFrames(buffer, options, targetWidth, targetHeight, onProgress?)` | Convert a GIF `ArrayBuffer` to animated frames; returns `{ frames, cols, rows, fps }` |
248
- | `videoToAsciiFrames(video, options, targetWidth, targetHeight, fps?, maxDuration?, onProgress?)` | Convert a `<video>` to animated frames; returns `{ frames, cols, rows, fps }` |
249
- | `generateEmbedCode(frame, options)` | Generate self-contained HTML embed string |
250
- | `generateAnimatedEmbedCode(frames, options, fps)` | Generate animated HTML embed string |
251
- | `asciiBackground(selector, options)` | Mount an animated ASCII background on an element; returns a cleanup function |
252
-
253
- ### Art Styles
254
-
255
- | Style | Charset | Color Mode |
249
+ | Function | Returns | Description |
256
250
  |---|---|---|
257
- | `classic` | ` .:-=+*#%@` | Grayscale |
258
- | `particles` | Dots mode | Full Color |
259
- | `letters` | A-Z a-z | Full Color |
260
- | `claudeCode` | Box drawing `╔╗╚╝║═...` | Accent |
261
- | `art` | Dense 70-char set | Full Color |
262
- | `terminal` | ` .:-=+*#%@` | Matrix green |
251
+ | `imageToAsciiFrame(source, options, w?, h?)` | `{ frame, cols, rows }` | Convert an image, video frame, or canvas to ASCII |
252
+ | `renderFrameToCanvas(ctx, frame, options, w, h, time?, hoverPos?)` | `void` | Render an ASCII frame to a 2D canvas context |
253
+ | `gifToAsciiFrames(buffer, options, w, h, onProgress?)` | `{ frames, cols, rows, fps }` | Parse an animated GIF `ArrayBuffer` into ASCII frames |
254
+ | `videoToAsciiFrames(video, options, w, h, fps?, maxDuration?, onProgress?)` | `{ frames, cols, rows, fps }` | Extract and convert video frames to ASCII |
255
+ | `asciiBackground(selector, options)` | `() => void` | Mount a live animated ASCII background; returns a cleanup function |
256
+ | `generateEmbedCode(frame, options)` | `string` | Self-contained static HTML embed |
257
+ | `generateAnimatedEmbedCode(frames, options, fps)` | `string` | Self-contained animated HTML embed |
263
258
 
264
- ### Options
259
+ ### Key Options (`AsciiOptions`)
265
260
 
266
- See `AsciiOptions` type for full configuration. Key options:
261
+ | Option | Type | Default | Description |
262
+ |---|---|---|---|
263
+ | `fontSize` | `number` | `10` | Character cell size in px |
264
+ | `colorMode` | `'grayscale' \| 'fullcolor' \| 'matrix' \| 'accent'` | `'grayscale'` | Color output mode |
265
+ | `renderMode` | `'ascii' \| 'dots'` | `'ascii'` | Render as characters or dot particles |
266
+ | `charset` | `string` | standard ramp | Custom character density ramp |
267
+ | `brightness` | `number` | `0` | Brightness adjustment (-1 → 1) |
268
+ | `contrast` | `number` | `1` | Contrast multiplier |
269
+ | `invert` | `boolean` | `false` | Invert luminance mapping |
270
+ | `hoverEffect` | `string` | `'none'` | Interactive effect name |
271
+ | `hoverStrength` | `number` | `0.8` | Effect intensity |
272
+ | `hoverRadius` | `number` | `0.3` | Effect radius (0–1 relative to canvas) |
273
+
274
+ ### Background Options
267
275
 
268
- - `fontSize` character size in pixels (default: 10)
269
- - `colorMode` — `'grayscale' | 'fullcolor' | 'matrix' | 'accent'`
270
- - `renderMode` `'ascii' | 'dots'`
271
- - `charset` character ramp string
272
- - `brightness` / `contrast` image adjustments
273
- - `invert` invert luminance mapping
274
- - `hoverEffect` / `hoverStrength` / `hoverRadius` interactive hover
276
+ | Option | Type | Default | Description |
277
+ |---|---|---|---|
278
+ | `type` | `string` | `'wave'` | Background renderer |
279
+ | `colorScheme` | `'auto' \| 'light' \| 'dark'` | `'dark'` | Theme; `'auto'` follows OS preference |
280
+ | `fontSize` | `number` | `13` | Character size |
281
+ | `speed` | `number` | `1` | Animation speed multiplier |
282
+ | `density` | `number` | `0.55` | Fraction of cells active (0–1) |
283
+ | `accentColor` | `string` | varies | Highlight / head colour |
275
284
 
276
285
  ## License
277
286
 
278
- MIT
287
+ MIT © [asciify.org](https://asciify.org)
288
+
289
+ ---
290
+
291
+ <p align="left">
292
+ <a href="https://www.buymeacoffee.com/asciify">☕ Buy me a coffee — if this saved you time, I'd appreciate it!</a>
293
+ </p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciify-engine",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
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",
@@ -39,6 +39,7 @@
39
39
  ],
40
40
  "author": "ayangabryl",
41
41
  "license": "MIT",
42
+ "homepage": "https://asciify.org",
42
43
  "repository": {
43
44
  "type": "git",
44
45
  "url": "https://github.com/ayangabryl/asciify"