@makefully/dutifully 1.15.0 → 1.16.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.16.0
4
+
5
+ - Add `classfully` service client for approximating images as CSS class rules.
6
+
3
7
  ## 1.15.0
4
8
 
5
9
  - Skip unchanged Sharp, Packfully, and Stackfully image outputs via embedded per-service metadata hashes (`CheerfullySharpHash`, `CheerfullyPackfullyHash`, `CheerfullyStackfullyHash`).
package/README.md CHANGED
@@ -156,6 +156,33 @@ Spacing: `padding` is empty gap beyond `extrude`; `extrude` is edge-pixel bleed
156
156
 
157
157
  Up-to-date atlas PNGs are skipped via an embedded `CheerfullyPackfullyHash` (source bytes + options). Descriptor files (json/css/atlas/xml) are not hash carriers.
158
158
 
159
+ ### Classfully
160
+
161
+ This image-to-CSS service approximates still images as a CSS class rule (deterministic mutation search scored via headless Chromium screenshots). Every image under `src` is processed; `files` overrides are optional.
162
+
163
+ ```javascript
164
+ {
165
+ "classfully": [{
166
+ "src": "./example/classfully/",
167
+ "output": "./example/classfully/out/",
168
+ "options": {
169
+ "maxIterations": 40,
170
+ "minAccuracy": 0.9,
171
+ "maxMutations": 256
172
+ },
173
+ "files": {
174
+ "swatch.png": {
175
+ "className": "swatch",
176
+ "css": "swatch.css"
177
+ }
178
+ }
179
+ }]
180
+ }
181
+ ```
182
+
183
+ * Omit `seed` to start from the image’s average `background-color`; pass `seed` (declarations or a `.css` file in `src`) to refine existing CSS.
184
+ * Output defaults to `{stem}.css` with `.{stem} { … }`; override with `css` / `output` and `className`.
185
+
159
186
  ### Sharp
160
187
 
161
188
  This still-image service converts, compresses, resizes, and can emit multi-size thumbnails or favicon packs (including `.ico`). Every image under `src` is processed; `files` overrides are optional.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/dutifully",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Client tools for Cheerfully service.",
5
5
  "main": "./src/index.js",
6
6
  "bin": {
@@ -18,6 +18,7 @@
18
18
  "scripts": {
19
19
  "test": "node --test test/**/*.test.js",
20
20
  "test-allosaurus": "node ./cheer.js -service allosaurus",
21
+ "test-classfully": "node ./cheer.js -service classfully",
21
22
  "test-elevenlabs": "node ./cheer.js -service elevenlabs",
22
23
  "test-ffmpeg": "node ./cheer.js -service ffmpeg",
23
24
  "test-packfully": "node ./cheer.js -service packfully",
@@ -48,7 +49,8 @@
48
49
  "captions",
49
50
  "packfully",
50
51
  "atlas",
51
- "spritesheet"
52
+ "spritesheet",
53
+ "classfully"
52
54
  ],
53
55
  "author": "Derek Detweiler <derek@makefullystudios.com>",
54
56
  "contributors": [
@@ -0,0 +1,15 @@
1
+ const
2
+ Cheer = require('./Cheer'),
3
+ Classfully = class Classfully extends Cheer {
4
+ beforeSend (archive) {
5
+ const
6
+ {src} = this.config;
7
+
8
+ if (src) {
9
+ archive.directory(src, false);
10
+ }
11
+ super.beforeSend(archive);
12
+ }
13
+ };
14
+
15
+ module.exports = Classfully;
package/src/index.js CHANGED
@@ -4,6 +4,7 @@ const
4
4
  LipSync = require('./classes/LipSync'),
5
5
  parsers = {
6
6
  allosaurus: LipSync,
7
+ classfully: require('./classes/Classfully'),
7
8
  elevenlabs: require('./classes/ElevenLabs'),
8
9
  ffmpeg: require('./classes/FFMPEG'),
9
10
  packfully: require('./classes/Packfully'),