spine-parts 2.14.0 → 2.14.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-parts",
3
- "version": "2.14.0",
3
+ "version": "2.14.1",
4
4
  "description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -52,7 +52,9 @@ import { type Mask, newMask, type Raster, RasterError } from './raster/types.ts'
52
52
  * - on FRONT's side of See-through's line, a pixel whose colour FRONT itself
53
53
  * holds deeper in (within half of {@link EDGE_CONTRAST}, and nearer that
54
54
  * than any BEHIND-side pixel) is FRONT's interior — a lining, a highlight —
55
- * and reads 1, however it falls along the axis.
55
+ * and reads 1, however it falls along the axis. On the silhouette (BEHIND is
56
+ * background), raw integer coverage 16..239 is graded and keeps its estimate:
57
+ * proximity to an interior colour does not establish opaque coverage (#1068).
56
58
  *
57
59
  * A painted pixel no part covers above the owner floor — the gap between two
58
60
  * soft rims — is owned by the nearest part (within `2 * EDGE_RADIUS + 2`), so
@@ -436,7 +438,8 @@ export function paintingEdges(parts: Raster[], srcr: Raster, options: PaintingEd
436
438
  let matte = Math.round((255 * Math.min(hi - lo, Math.max(0, along(p) - lo))) / (hi - lo));
437
439
  // On FRONT's side of the line, a colour FRONT itself holds deeper in (within half the contrast floor, and nearer FRONT than
438
440
  // BEHIND) is FRONT's interior — a light lining, a highlight — not a mix with BEHIND, however it falls along the axis.
439
- if (a === front && matte < 255) {
441
+ const gradedSilhouette = behind === -1 && matte >= 16 && matte <= 239;
442
+ if (a === front && matte < 255 && !gradedSilhouette) {
440
443
  let dF = Infinity;
441
444
  let dFdeep = Infinity;
442
445
  for (let qy = Math.max(0, y - R); qy <= Math.min(H - 1, y + R); qy++) {