pixelkiln 0.94.0 → 0.95.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/docs/MANIFEST.md CHANGED
@@ -56,7 +56,7 @@ not merely a label edit.
56
56
 
57
57
  | Field | Type/default | Meaning |
58
58
  |---|---|---|
59
- | `prompt` | string, required unless `mirror`, `portrait`, `outfit`, or a template loop (`animation.template`) | The subject wording wrapped by the selected style's prompt prefix and suffix. A template loop is described by its template; a v3, pro, or sentence (`skeleton-v3` with no template) loop still needs the motion in words. |
59
+ | `prompt` | string, required unless `mirror`, `derive`, `external`, `portrait`, `outfit`, or a template loop (`animation.template`) | The subject wording wrapped by the selected style's prompt prefix and suffix. A template loop is described by its template; a v3, pro, or sentence (`skeleton-v3` with no template) loop still needs the motion in words. |
60
60
  | `width` / `height` | integer 16–8192 | Per-asset dimensions for generators that accept rectangular output. Provider limits may be lower. |
61
61
  | `size` | integer 16–8192 | Per-asset square size where the generator uses one dimension. |
62
62
  | `file` | string | Output path below the style's `outDir`; defaults to `<category>/<assetId>.png`. |
@@ -70,6 +70,8 @@ not merely a label edit.
70
70
  | `portrait` | object | `character` styles: a bust of a base or state's south sprite, `{ "of": "<asset>", "size": 64 }`; `size` is 16, 32, 48, 64 (default), 128, or 160. See [Portraits](./CHARACTERS.md#portraits). |
71
71
  | `outfit` | object | `character` styles: an existing loop's frames re-clothed from an outfit image, `{ "of": "<loop asset>", "reference": "<image>" }`, with optional `additionalInstructions`. See [Outfit transfer](./CHARACTERS.md#outfit-transfer). |
72
72
  | `mirror` | string | Another asset of the same style flipped left to right, made locally at no cost. See [Mirrors](./CHARACTERS.md#mirrors). |
73
+ | `derive` | object | Made from existing pixels by one local transform, at no cost, with no provider. See [Derived and external assets](#derived-and-external-assets). |
74
+ | `external` | object | Built by a script or tool outside pixelkiln; pixelkiln records and tracks the file but never builds it. See [Derived and external assets](#derived-and-external-assets). |
73
75
  | `vfx` | object | `vfx` styles, PixelLab only: the effect to render. `{ "preset": "explosion", "parts": [{ "name": "scorch_mark" }], "sprite": "art/chars/hero.png", "fps": 12 }`; start from one `preset` or one `recipe` (a recipe JSON or a `.vfx.json` record), with optional `parts`, `sprite`, `fps`, and `name`. Or give a `description` (with optional `artist`: `lite` or `pro`, a local PNG `sprite`, and `name`) for PixelLab's paid VFX artist instead; it excludes `preset`, `recipe`, `parts`, and `fps`. Replaces `prompt` as the required field. See [`vfx`](./GENERATORS.md#vfx) and [Described effects](./GENERATORS.md#described-effects-the-paid-vfx-artist). |
74
76
  | `scene` | object | `map` styles, PixelLab only: draw this object into a scene image, in its style. `{ "image": "scene.png", "placement": { "oval": 0.3 } }`; `placement` is `oval` or `rectangle` (a fraction, 0.05–0.95) or `mask` (a PNG the size of the scene). See [Drawing into a scene](./GENERATORS.md#drawing-into-a-scene). |
75
77
  | `connect` | object | `terrain` styles, PixelLab only: share a terrain with another set in the same style, keyed by this set's own side. `{ "lower": { "of": "coast", "terrain": "upper" } }` makes this set's lower terrain `coast`'s upper. The other set generates first; regenerating it makes this one stale. A sidescroller set connects only `lower`. Cycles are rejected. |
@@ -430,6 +432,54 @@ changing `provider` alone:
430
432
  declare bindings (ComfyUI); a provider without them rejects a non-empty
431
433
  object rather than ignoring it.
432
434
 
435
+ ## Derived and external assets
436
+
437
+ Not every asset is generated. Art recolored from another asset, or built by a
438
+ script, still belongs in `plan`, the lockfile, and quality snapshots. Two
439
+ asset kinds declare that, and they are deliberately separate: one pixelkiln
440
+ makes itself, one it only keeps track of.
441
+
442
+ ### `derive`: made by pixelkiln from existing pixels
443
+
444
+ ```json
445
+ "hedge_autumn": { "derive": { "from": "hedge", "transform": "recolor", "map": { "#4a7a3a": "#b8742c" } } },
446
+ "hedge_2x": { "derive": { "from": "hedge", "transform": "scale", "width": 64, "height": 64 } },
447
+ "tile_snapped": { "derive": { "file": "art/tile.png", "transform": "palette-snap", "palette": ["#000000", "#ffffff"] } }
448
+ ```
449
+
450
+ The input is `from` (another asset of the same style, which must be a single
451
+ image) or `file` (a committed PNG, relative to the manifest), never both. The
452
+ transform is one of:
453
+
454
+ | `transform` | Fields | Does |
455
+ |---|---|---|
456
+ | `recolor` | `map` | Replaces exact `#rrggbb` colors. Unmapped colors and every alpha value stay. |
457
+ | `palette-snap` | `palette` (2 to 256 colors) | Moves every visible pixel to the nearest palette color. |
458
+ | `scale` | `width`, `height`, `mode` | Resizes to the exact size. `nearest` (default) keeps hard edges; `box` averages the covered pixels, weighted by alpha. |
459
+
460
+ `gen` writes the file in the wave after its source lands, calls no provider, and
461
+ costs nothing in any unit. The plan reports a derived asset `stale`, free to fix,
462
+ when its source's recorded output, its `file`, the transform, or its parameters
463
+ change. An edit by hand makes it `orphaned`, like any generated file. The lock entry
464
+ records the input's hash under `derive`.
465
+
466
+ ### `external`: built elsewhere, tracked here
467
+
468
+ ```json
469
+ "dock": { "external": { "builder": "python tools/iso_kit.py dock", "inputs": ["tools/iso_kit.py"] } }
470
+ ```
471
+
472
+ pixelkiln never runs the `builder`; it is the command you run, recorded so the
473
+ plan can tell you what to do. `inputs` are files the builder reads. Their hashes
474
+ and the builder text are the asset's identity. Record the built file with
475
+ `adopt --local`, which stores the file's hash, the builder, and the inputs' hashes.
476
+
477
+ An external asset is never actionable, so `gen` skips it, including under
478
+ `--force`. The plan reports it as: `untracked` when the file exists but is not
479
+ recorded (run `adopt --local`), `orphaned` when the file is missing, when the
480
+ builder or an input changed, or when the file changed since it was recorded
481
+ (rebuild, then `adopt --local --force`), and `ok` otherwise.
482
+
433
483
  ## Characters and mirrors
434
484
 
435
485
  A `character` style holds a base drawn facing 4 or 8 directions, states, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.94.0",
3
+ "version": "0.95.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1825,6 +1825,87 @@
1825
1825
  "type": "string",
1826
1826
  "minLength": 1
1827
1827
  },
1828
+ "derive": {
1829
+ "type": "object",
1830
+ "properties": {
1831
+ "from": {
1832
+ "type": "string",
1833
+ "minLength": 1
1834
+ },
1835
+ "file": {
1836
+ "type": "string",
1837
+ "minLength": 1
1838
+ },
1839
+ "transform": {
1840
+ "type": "string",
1841
+ "enum": [
1842
+ "recolor",
1843
+ "palette-snap",
1844
+ "scale"
1845
+ ]
1846
+ },
1847
+ "map": {
1848
+ "type": "object",
1849
+ "additionalProperties": {
1850
+ "type": "string",
1851
+ "pattern": "^#?[0-9a-f]{6}$"
1852
+ },
1853
+ "propertyNames": {
1854
+ "pattern": "^#?[0-9a-f]{6}$"
1855
+ }
1856
+ },
1857
+ "palette": {
1858
+ "type": "array",
1859
+ "items": {
1860
+ "type": "string",
1861
+ "pattern": "^#?[0-9a-f]{6}$"
1862
+ },
1863
+ "minItems": 2,
1864
+ "maxItems": 256
1865
+ },
1866
+ "width": {
1867
+ "type": "integer",
1868
+ "minimum": 1,
1869
+ "maximum": 4096
1870
+ },
1871
+ "height": {
1872
+ "type": "integer",
1873
+ "minimum": 1,
1874
+ "maximum": 4096
1875
+ },
1876
+ "mode": {
1877
+ "type": "string",
1878
+ "enum": [
1879
+ "nearest",
1880
+ "box"
1881
+ ]
1882
+ }
1883
+ },
1884
+ "required": [
1885
+ "transform"
1886
+ ],
1887
+ "additionalProperties": false
1888
+ },
1889
+ "external": {
1890
+ "type": "object",
1891
+ "properties": {
1892
+ "builder": {
1893
+ "type": "string",
1894
+ "minLength": 1
1895
+ },
1896
+ "inputs": {
1897
+ "type": "array",
1898
+ "items": {
1899
+ "type": "string",
1900
+ "minLength": 1
1901
+ }
1902
+ }
1903
+ },
1904
+ "required": [
1905
+ "builder"
1906
+ ],
1907
+ "additionalProperties": false
1908
+ },
1828
1909
  "outputRole": {
1829
1910
  "type": "string",
1830
1911
  "minLength": 1