@pixerate/editor 0.115.0 → 0.117.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.
Files changed (127) hide show
  1. package/THIRD_PARTY_NOTICES.md +3 -0
  2. package/dist/animation-editor/index.cjs +54 -54
  3. package/dist/animation-editor/index.d.cts +2 -2
  4. package/dist/animation-editor/index.d.ts +2 -2
  5. package/dist/animation-editor/index.js +2 -2
  6. package/dist/{chunk-I7FQBWMQ.cjs → chunk-2J3LS7JZ.cjs} +333 -333
  7. package/dist/{chunk-I7FQBWMQ.cjs.map → chunk-2J3LS7JZ.cjs.map} +1 -1
  8. package/dist/{chunk-TFOPHZ3U.cjs → chunk-7ISPWEJA.cjs} +302 -5
  9. package/dist/chunk-7ISPWEJA.cjs.map +1 -0
  10. package/dist/{chunk-VXR7XWMF.js → chunk-7LNZAWSJ.js} +437 -41
  11. package/dist/chunk-7LNZAWSJ.js.map +1 -0
  12. package/dist/{chunk-DFQEX3AM.cjs → chunk-BYAWOAST.cjs} +223 -30
  13. package/dist/chunk-BYAWOAST.cjs.map +1 -0
  14. package/dist/chunk-COAMRKVI.cjs +159 -0
  15. package/dist/chunk-COAMRKVI.cjs.map +1 -0
  16. package/dist/{chunk-ST7E3NEE.cjs → chunk-EBSYZRSW.cjs} +230 -732
  17. package/dist/chunk-EBSYZRSW.cjs.map +1 -0
  18. package/dist/chunk-EJVDBITD.cjs +501 -0
  19. package/dist/chunk-EJVDBITD.cjs.map +1 -0
  20. package/dist/{chunk-LPLCWZTM.cjs → chunk-FODKPD44.cjs} +555 -159
  21. package/dist/chunk-FODKPD44.cjs.map +1 -0
  22. package/dist/{chunk-XK5LZKBD.js → chunk-HKDTM6VC.js} +298 -1
  23. package/dist/chunk-HKDTM6VC.js.map +1 -0
  24. package/dist/chunk-IPFRWILU.js +1908 -0
  25. package/dist/chunk-IPFRWILU.js.map +1 -0
  26. package/dist/chunk-IVSNUXW7.js +3339 -0
  27. package/dist/chunk-IVSNUXW7.js.map +1 -0
  28. package/dist/{chunk-LKCYANMW.js → chunk-JHXMNOMF.js} +198 -5
  29. package/dist/chunk-JHXMNOMF.js.map +1 -0
  30. package/dist/{chunk-FV5AXTSF.cjs → chunk-JSSBHMMU.cjs} +36 -188
  31. package/dist/chunk-JSSBHMMU.cjs.map +1 -0
  32. package/dist/chunk-L2T6EJ5S.cjs +3339 -0
  33. package/dist/chunk-L2T6EJ5S.cjs.map +1 -0
  34. package/dist/chunk-LF4WOZXZ.js +159 -0
  35. package/dist/chunk-LF4WOZXZ.js.map +1 -0
  36. package/dist/{chunk-26PGXHY7.cjs → chunk-M7O4BJRH.cjs} +36 -36
  37. package/dist/{chunk-26PGXHY7.cjs.map → chunk-M7O4BJRH.cjs.map} +1 -1
  38. package/dist/chunk-N3467VD6.js +501 -0
  39. package/dist/chunk-N3467VD6.js.map +1 -0
  40. package/dist/{chunk-XICA4PVO.js → chunk-R2JE6SA7.js} +17 -17
  41. package/dist/chunk-SMJGE7HM.cjs +1908 -0
  42. package/dist/chunk-SMJGE7HM.cjs.map +1 -0
  43. package/dist/{chunk-MMVHBKMM.js → chunk-T2P5TIZ6.js} +2 -2
  44. package/dist/{chunk-C6C5PDKU.js → chunk-VD2UDVF7.js} +102 -604
  45. package/dist/chunk-VD2UDVF7.js.map +1 -0
  46. package/dist/{chunk-FGW5OWJ4.js → chunk-VJUML33I.js} +4 -156
  47. package/dist/chunk-VJUML33I.js.map +1 -0
  48. package/dist/export/index.cjs +4 -2
  49. package/dist/export/index.cjs.map +1 -1
  50. package/dist/export/index.js +5 -3
  51. package/dist/{export-BJE8T0YA.d.cts → export-DMOuzgZZ.d.cts} +9 -4
  52. package/dist/{export-Con3UKkm.d.ts → export-Dul1SbPv.d.ts} +9 -4
  53. package/dist/export-Dv0-ZVrV.d.cts +501 -0
  54. package/dist/export-Dv0-ZVrV.d.ts +501 -0
  55. package/dist/{retouch-Bxkuc0KH.d.cts → flow-4-OC-UkQ.d.cts} +582 -2
  56. package/dist/{retouch-Do6tBs2H.d.ts → flow-Cb7lkPm8.d.ts} +582 -2
  57. package/dist/image-editor/index.cjs +1345 -1095
  58. package/dist/image-editor/index.cjs.map +1 -1
  59. package/dist/image-editor/index.d.cts +8 -8
  60. package/dist/image-editor/index.d.ts +8 -8
  61. package/dist/image-editor/index.js +300 -50
  62. package/dist/image-editor/index.js.map +1 -1
  63. package/dist/index.cjs +4 -2
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.js +5 -3
  66. package/dist/index.js.map +1 -1
  67. package/dist/kernel-wasm-WYCGNZR4.js +10 -0
  68. package/dist/kernel-wasm-WYCGNZR4.js.map +1 -0
  69. package/dist/kernel-wasm-YPVAEMVN.cjs +10 -0
  70. package/dist/kernel-wasm-YPVAEMVN.cjs.map +1 -0
  71. package/dist/paint/index.cjs +170 -4
  72. package/dist/paint/index.cjs.map +1 -1
  73. package/dist/paint/index.d.cts +225 -3
  74. package/dist/paint/index.d.ts +225 -3
  75. package/dist/paint/index.js +171 -5
  76. package/dist/paint-editor/index.cjs +4735 -890
  77. package/dist/paint-editor/index.cjs.map +1 -1
  78. package/dist/paint-editor/index.d.cts +1526 -278
  79. package/dist/paint-editor/index.d.ts +1526 -278
  80. package/dist/paint-editor/index.js +4561 -716
  81. package/dist/paint-editor/index.js.map +1 -1
  82. package/dist/raster/index.cjs +7 -4
  83. package/dist/raster/index.cjs.map +1 -1
  84. package/dist/raster/index.d.cts +2 -2
  85. package/dist/raster/index.d.ts +2 -2
  86. package/dist/raster/index.js +36 -33
  87. package/dist/{render-CrmHOgpo.d.ts → render-B05K68_h.d.ts} +9 -1
  88. package/dist/{render-B1K_OoLy.d.cts → render-DnAbIKcs.d.cts} +9 -1
  89. package/dist/{svg-BnRj0q8i.d.cts → svg-CVdFc80-.d.cts} +2 -2
  90. package/dist/{svg-CmmBFfGT.d.ts → svg-DlEuhwoX.d.ts} +2 -2
  91. package/dist/{types-1SUQKDAw.d.ts → types-CDLGhAZp.d.ts} +40 -2
  92. package/dist/{types-yINF17Ta.d.cts → types-Tfly4Aya.d.cts} +40 -2
  93. package/dist/vector/index.cjs +6536 -4525
  94. package/dist/vector/index.cjs.map +1 -1
  95. package/dist/vector/index.d.cts +426 -32
  96. package/dist/vector/index.d.ts +426 -32
  97. package/dist/vector/index.js +11397 -9386
  98. package/dist/vector/index.js.map +1 -1
  99. package/dist/video-editor/index.cjs +502 -2165
  100. package/dist/video-editor/index.cjs.map +1 -1
  101. package/dist/video-editor/index.d.cts +3 -501
  102. package/dist/video-editor/index.d.ts +3 -501
  103. package/dist/video-editor/index.js +151 -1814
  104. package/dist/video-editor/index.js.map +1 -1
  105. package/package.json +1 -1
  106. package/skills/pixerate-image-editor/references/photoshop-files.md +7 -3
  107. package/skills/pixerate-vector/SKILL.md +3 -0
  108. package/dist/chunk-C6C5PDKU.js.map +0 -1
  109. package/dist/chunk-DFQEX3AM.cjs.map +0 -1
  110. package/dist/chunk-FGW5OWJ4.js.map +0 -1
  111. package/dist/chunk-FV5AXTSF.cjs.map +0 -1
  112. package/dist/chunk-GX332W2C.js +0 -181
  113. package/dist/chunk-GX332W2C.js.map +0 -1
  114. package/dist/chunk-LKCYANMW.js.map +0 -1
  115. package/dist/chunk-LPLCWZTM.cjs.map +0 -1
  116. package/dist/chunk-MUUXNRU4.cjs +0 -181
  117. package/dist/chunk-MUUXNRU4.cjs.map +0 -1
  118. package/dist/chunk-ST7E3NEE.cjs.map +0 -1
  119. package/dist/chunk-TCKIXI46.cjs +0 -1136
  120. package/dist/chunk-TCKIXI46.cjs.map +0 -1
  121. package/dist/chunk-TFOPHZ3U.cjs.map +0 -1
  122. package/dist/chunk-UBIXVXPR.js +0 -1136
  123. package/dist/chunk-UBIXVXPR.js.map +0 -1
  124. package/dist/chunk-VXR7XWMF.js.map +0 -1
  125. package/dist/chunk-XK5LZKBD.js.map +0 -1
  126. /package/dist/{chunk-XICA4PVO.js.map → chunk-R2JE6SA7.js.map} +0 -0
  127. /package/dist/{chunk-MMVHBKMM.js.map → chunk-T2P5TIZ6.js.map} +0 -0
@@ -358,7 +358,7 @@ import {
358
358
  writePsd,
359
359
  xyToTempTint,
360
360
  xyToUv
361
- } from "../chunk-XICA4PVO.js";
361
+ } from "../chunk-R2JE6SA7.js";
362
362
  import {
363
363
  loadDocument
364
364
  } from "../chunk-U5HZSFCS.js";
@@ -366,7 +366,6 @@ import {
366
366
  createCaptureTool
367
367
  } from "../chunk-REOJJIY3.js";
368
368
  import {
369
- BIT_DEPTHS,
370
369
  DEFAULT_GLOBAL_LIGHT,
371
370
  DIRECT_GAUSSIAN_MAX_SIGMA,
372
371
  INTERPOLATIONS,
@@ -377,38 +376,28 @@ import {
377
376
  PatternPlacement,
378
377
  PatternTile,
379
378
  TransformTooLargeError,
380
- base64ToBytes,
381
379
  blendTile,
382
380
  builtinPattern,
383
381
  builtinPatternIds,
384
- bytesToBase64,
385
382
  changedTiles,
386
383
  compositeSurfaceOver,
387
- convertSurfaceDepth,
388
384
  curveLut,
389
- decodePng,
390
- deepBytes,
391
- deepTile,
392
385
  defaultEffectGradient,
393
386
  defaultLayerEffect,
394
- depthOf,
395
387
  effectColorHex,
396
388
  effectReach,
397
389
  effectsFingerprint,
398
390
  effectsMargin,
399
391
  effectsScale,
400
- encodePng,
401
392
  findLayer,
402
393
  flattenLayers,
403
394
  gaussianBlur,
404
395
  hasActiveEffects,
405
396
  hashNoise,
406
397
  insertLayer,
407
- isBitDepth,
408
398
  isInterpolation,
409
399
  isLayerEffectKind,
410
400
  isLayerLocked,
411
- isPng,
412
401
  keysWeight,
413
402
  layerEffectFields,
414
403
  layerEffectLabel,
@@ -416,45 +405,34 @@ import {
416
405
  mergeLayerEffect,
417
406
  newEffectId,
418
407
  normalizeLayerEffects,
419
- parseDataUrl,
420
408
  parseEffectColor,
421
- pngDataUrl,
422
- proxyOf,
423
- readDeepRegion,
424
409
  reduceSurface,
425
410
  renderLayerEffects,
426
411
  scaleLayerEffect,
427
- srgbDecode,
428
- srgbEncode,
429
- surfaceDepth,
430
- surfaceFromDeepPixels,
431
- tileSamples,
432
- tileSamples16,
433
- tileSamples32,
434
- to16From32,
435
- to16From8,
436
- to32From16,
437
- to32From8,
438
- to8From16,
439
- to8From32,
440
412
  transformSurface,
441
413
  transformedBounds,
442
414
  validateEffectGradient,
443
415
  validateLayerEffect,
444
416
  validateLayerEffects,
445
417
  warpSurface,
446
- workingToSamples,
447
- writeDeepRegion
448
- } from "../chunk-C6C5PDKU.js";
418
+ workingToSamples
419
+ } from "../chunk-VD2UDVF7.js";
449
420
  import {
450
421
  applyHomography,
422
+ base64ToBytes,
451
423
  boxQuad,
424
+ bytesToBase64,
425
+ decodePng,
426
+ encodePng,
452
427
  homographyFromAffine,
453
428
  homographyFromPoints,
454
429
  invertHomography,
430
+ isPng,
455
431
  multiplyHomographies,
432
+ parseDataUrl,
433
+ pngDataUrl,
456
434
  rectToQuad
457
- } from "../chunk-GX332W2C.js";
435
+ } from "../chunk-N3467VD6.js";
458
436
  import {
459
437
  DEFAULT_RETOUCH,
460
438
  RETOUCH_SAMPLES,
@@ -464,6 +442,7 @@ import {
464
442
  TONE_RANGES,
465
443
  TilePixelSource,
466
444
  applyRetouchToTile,
445
+ applyToneToDeepTile,
467
446
  bestOffset,
468
447
  dilateMask,
469
448
  dodgeBurn,
@@ -473,6 +452,9 @@ import {
473
452
  maskBounds,
474
453
  membraneFill,
475
454
  normalizeRetouch,
455
+ paintPathStroke,
456
+ pathStrokeCoverage,
457
+ pathStrokeDabs,
476
458
  perDabStrength,
477
459
  readSourceRegion,
478
460
  rgbaViewOfGrey,
@@ -485,48 +467,128 @@ import {
485
467
  spotHealPixels,
486
468
  spotHealWindow,
487
469
  toneOf
488
- } from "../chunk-LKCYANMW.js";
470
+ } from "../chunk-JHXMNOMF.js";
489
471
  import {
472
+ BODY_SCATTER,
490
473
  CoverageMap,
491
474
  DEFAULT_BLENDER,
492
475
  DEFAULT_BRUSH,
476
+ DEFAULT_FLOW,
493
477
  DEFAULT_MIXER,
494
478
  DEFAULT_SMUDGE,
479
+ DEFAULT_WET_PAPER,
480
+ DEFAULT_WET_PARAMS,
481
+ DRY_EPS,
495
482
  DabWalker,
496
483
  EMPTY_MIXER_LOAD,
484
+ EX,
485
+ EY,
486
+ FLAG_ALIVE,
487
+ FLAG_BOTTOM,
488
+ FLAG_LEFT,
489
+ FLAG_RIGHT,
490
+ FLAG_TOP,
491
+ FLAG_WET,
492
+ FLAT,
493
+ FREE_INTERVAL,
494
+ HIDE,
495
+ MAX_BATCH,
497
496
  MAX_BRUSH_SIZE,
497
+ MAX_TILT_ACCEL,
498
+ MAX_WET_LANES,
499
+ MAX_WET_SLOTS,
498
500
  MIXER_DRAIN,
499
501
  MIXER_PICKUP_RATE,
500
502
  MIXING_MODELS,
501
503
  MixerStroke,
504
+ OPP,
505
+ PAPER_CAPACITY,
506
+ PARAM,
507
+ PARAM_FLOATS,
508
+ PIGMENT_CHANNELS,
509
+ PIGMENT_UNIT,
510
+ PLANE,
511
+ PLANE_BYTES,
512
+ P_D0,
513
+ P_EDGE,
514
+ P_FX,
515
+ P_FY,
516
+ P_H,
517
+ P_P0,
518
+ P_RHO,
519
+ P_SW,
520
+ P_UX,
521
+ P_UY,
502
522
  PaintExchange,
523
+ SET_PLANES,
524
+ SLOT_BYTES,
525
+ SLOT_PLANES,
526
+ SLOT_SIDE,
527
+ SRGB_TO_LINEAR,
528
+ STRIP,
503
529
  SmudgeTip,
504
530
  StrokeCoverage,
505
531
  TileMedium,
532
+ U_MAX,
533
+ W9,
534
+ WET_FLOW_KINDS,
535
+ WET_PARAM_KEYS,
536
+ WET_TILE,
537
+ WetMedium,
538
+ WetWorkerPool,
539
+ WetWorld,
540
+ WetWorldError,
541
+ applyStrokeToDeepTile,
506
542
  applyStrokeToTile,
507
543
  blendRadius,
508
544
  blenderDab,
545
+ canShareMemory,
509
546
  cleanMixer,
510
547
  coverageTileCoord,
511
548
  createBlenderScratch,
512
549
  createPigmentTools,
513
550
  dabCoverage,
514
551
  dabRect,
552
+ dexp,
553
+ dlog,
554
+ dpow,
555
+ dsincos,
556
+ edgeBits,
515
557
  exchangeRates,
558
+ expNeg,
559
+ filmPixel,
560
+ filmReflectance,
561
+ flowField,
562
+ latticeViscosity,
563
+ linearToSrgb8,
516
564
  loadMixer,
565
+ loadWetKernel,
517
566
  mixerRates,
518
567
  normalizeBlender,
519
568
  normalizeBrush,
569
+ normalizeFlow,
520
570
  normalizeMixer,
521
571
  normalizeSmudge,
572
+ normalizeTilt,
573
+ normalizeWetParams,
574
+ packWetParams,
575
+ pigmentColor,
576
+ pigmentOf,
577
+ pixelPigment,
522
578
  rasterizeDab,
579
+ shadeTile,
523
580
  smoothPoints,
581
+ srgbByteToLinear,
582
+ stepSlotTs,
524
583
  tipFalloff,
525
584
  tipReach,
526
585
  tipShape,
527
- walkDabs
528
- } from "../chunk-UBIXVXPR.js";
586
+ walkDabs,
587
+ wetSimdSupported,
588
+ wetSupport
589
+ } from "../chunk-IVSNUXW7.js";
529
590
  import {
591
+ BIT_DEPTHS,
530
592
  BLEND_MODES,
531
593
  PAINTERLY_BLEND_MODES,
532
594
  PIGMENT_BANDS,
@@ -546,13 +608,19 @@ import {
546
608
  canvasCompositeOperation,
547
609
  collectTiles,
548
610
  contentBounds,
611
+ convertSurfaceDepth,
549
612
  createPigment,
613
+ deepBytes,
614
+ deepTile,
615
+ depthOf,
550
616
  emptySurface,
551
617
  fillRect,
552
618
  finishTile,
619
+ isBitDepth,
553
620
  isBlendMode,
554
621
  isPainterlyBlendMode,
555
622
  isSeparableBlendMode,
623
+ keepDeepSamples,
556
624
  lerpPigment,
557
625
  lerpPigmentInto,
558
626
  mixPigment8,
@@ -561,6 +629,8 @@ import {
561
629
  normalizeBlendMode,
562
630
  packRgba,
563
631
  pigment8,
632
+ proxyOf,
633
+ readDeepRegion,
564
634
  readPixel,
565
635
  readRegion,
566
636
  reflectanceToRgb,
@@ -568,18 +638,32 @@ import {
568
638
  setLum,
569
639
  setPigmentColor,
570
640
  solidSurface,
641
+ srgbDecode,
642
+ srgbEncode,
571
643
  standardBlendMode,
572
644
  surfaceBytes,
645
+ surfaceDepth,
646
+ surfaceFromDeepPixels,
573
647
  surfaceFromPixels,
574
648
  surfacesEqual,
575
649
  tileCoord,
576
650
  tileKey,
577
651
  tileRect,
652
+ tileSamples,
653
+ tileSamples16,
654
+ tileSamples32,
578
655
  tilesInRect,
656
+ to16From32,
657
+ to16From8,
658
+ to32From16,
659
+ to32From8,
660
+ to8From16,
661
+ to8From32,
579
662
  translateSurface,
580
663
  uniformTile,
664
+ writeDeepRegion,
581
665
  writeRegion
582
- } from "../chunk-XK5LZKBD.js";
666
+ } from "../chunk-HKDTM6VC.js";
583
667
  import {
584
668
  BUILTIN_PROFILES,
585
669
  CmsError,
@@ -642,7 +726,7 @@ import {
642
726
  warpMeshParamAt,
643
727
  warpMeshRows,
644
728
  warpPresetMesh
645
- } from "../chunk-VXR7XWMF.js";
729
+ } from "../chunk-7LNZAWSJ.js";
646
730
  import "../chunk-YCSFS3GK.js";
647
731
  import "../chunk-ZRJMJIQU.js";
648
732
  import "../chunk-TGD52FEZ.js";
@@ -2168,7 +2252,7 @@ function checkPixels(p) {
2168
2252
  if (p.data.length < n * 4) throw new Error("Pixel data is shorter than width \xD7 height \xD7 4");
2169
2253
  return n;
2170
2254
  }
2171
- var SRGB_TO_LINEAR = (() => {
2255
+ var SRGB_TO_LINEAR2 = (() => {
2172
2256
  const t = new Float32Array(256);
2173
2257
  for (let i = 0; i < 256; i++) {
2174
2258
  const v = i / 255;
@@ -2178,9 +2262,9 @@ var SRGB_TO_LINEAR = (() => {
2178
2262
  })();
2179
2263
  var labF = (t) => t > 216 / 24389 ? Math.cbrt(t) : (24389 / 27 * t + 16) / 116;
2180
2264
  function srgb8ToLab(r, g, b) {
2181
- const rl = SRGB_TO_LINEAR[r & 255];
2182
- const gl = SRGB_TO_LINEAR[g & 255];
2183
- const bl = SRGB_TO_LINEAR[b & 255];
2265
+ const rl = SRGB_TO_LINEAR2[r & 255];
2266
+ const gl = SRGB_TO_LINEAR2[g & 255];
2267
+ const bl = SRGB_TO_LINEAR2[b & 255];
2184
2268
  const x = (0.4124564 * rl + 0.3575761 * gl + 0.1804375 * bl) / 0.95047;
2185
2269
  const y = 0.2126729 * rl + 0.7151522 * gl + 0.072175 * bl;
2186
2270
  const z = (0.0193339 * rl + 0.119192 * gl + 0.9503041 * bl) / 1.08883;
@@ -2635,6 +2719,28 @@ function selectionSurface(sel) {
2635
2719
  function liftPixels(surface, sel, o) {
2636
2720
  const sb = sel.bounds;
2637
2721
  const area = { x: sb.x - o.x, y: sb.y - o.y, width: sb.width, height: sb.height };
2722
+ const depth = surfaceDepth(surface);
2723
+ if (depth !== 8) {
2724
+ const px3 = readDeepRegion(surface, area, depth);
2725
+ const kept2 = px3.slice();
2726
+ const r16 = depth === 16;
2727
+ for (let y = 0; y < area.height; y++) {
2728
+ for (let x = 0; x < area.width; x++) {
2729
+ const k = sel.data[(sb.y + y) * sel.width + sb.x + x] / 255;
2730
+ const i = (y * area.width + x) * 4;
2731
+ if (k <= 0) {
2732
+ px3[i] = px3[i + 1] = px3[i + 2] = px3[i + 3] = 0;
2733
+ continue;
2734
+ }
2735
+ px3[i + 3] = r16 ? Math.round(px3[i + 3] * k) : px3[i + 3] * k;
2736
+ if (!px3[i + 3]) px3[i] = px3[i + 1] = px3[i + 2] = 0;
2737
+ kept2[i + 3] = r16 ? Math.round(kept2[i + 3] * (1 - k)) : kept2[i + 3] * (1 - k);
2738
+ if (!kept2[i + 3]) kept2[i] = kept2[i + 1] = kept2[i + 2] = 0;
2739
+ }
2740
+ }
2741
+ const lifted = writeDeepRegion(new TiledSurface(4, /* @__PURE__ */ new Map(), 0), area, px3);
2742
+ return { lifted, rest: writeDeepRegion(surface, area, kept2) };
2743
+ }
2638
2744
  const px2 = readRegion(surface, area);
2639
2745
  const kept = new Uint8ClampedArray(px2);
2640
2746
  for (let y = 0; y < area.height; y++) {
@@ -3274,7 +3380,7 @@ var IMAGE_EDITOR_SCHEMA_VERSION = LAYERED_SCHEMA_VERSION;
3274
3380
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
3275
3381
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3276
3382
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
3277
- function paintCoverageInto(base, coverage, apply, rects) {
3383
+ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
3278
3384
  const tiles = new Map(base.tiles);
3279
3385
  const done = /* @__PURE__ */ new Set();
3280
3386
  for (const r of rects) {
@@ -3282,6 +3388,13 @@ function paintCoverageInto(base, coverage, apply, rects) {
3282
3388
  const key = tileKey(t.tx, t.ty);
3283
3389
  if (done.has(key)) continue;
3284
3390
  done.add(key);
3391
+ if (depth && base.channels === 4) {
3392
+ const d = applyStrokeToDeepTile(coverage, tileSamples(base.tiles.get(key), 4, depth, base.defaultValue), t.tx, t.ty, apply);
3393
+ const tile2 = deepTile(d, 4, base.defaultValue);
3394
+ if (tile2) tiles.set(key, tile2);
3395
+ else tiles.delete(key);
3396
+ continue;
3397
+ }
3285
3398
  const src = base.tiles.get(key)?.data ?? defaultTile(base);
3286
3399
  const data = applyStrokeToTile(coverage, src, base.channels, t.tx, t.ty, apply);
3287
3400
  const tile = finishTile(data, base.channels, base.defaultValue);
@@ -3297,10 +3410,12 @@ function defaultTile(s) {
3297
3410
  return d;
3298
3411
  }
3299
3412
  var PaintStrokeSession = class {
3300
- constructor(controller, target, stroke, apply) {
3413
+ constructor(controller, target, stroke, apply, depth = null) {
3301
3414
  this.controller = controller;
3302
3415
  this.target = target;
3303
3416
  this.apply = apply;
3417
+ const coverage = stroke instanceof StrokeCoverage || "kind" in stroke && stroke.kind === "coverage" && !stroke.finalPaint;
3418
+ this.deep = depth && coverage && target.surface.channels === 4 ? depth : null;
3304
3419
  this.before = controller._captureForStroke();
3305
3420
  this.base = target.surface;
3306
3421
  this.live = new Map(this.base.tiles);
@@ -3343,6 +3458,9 @@ var PaintStrokeSession = class {
3343
3458
  fresh = /* @__PURE__ */ new Set();
3344
3459
  last = null;
3345
3460
  closed = false;
3461
+ /** Brush and eraser strokes on a 16- or 32-bit document: the deep samples of each touched tile. */
3462
+ deep;
3463
+ liveDeep = /* @__PURE__ */ new Map();
3346
3464
  /** The new tile of a coverage stroke over the pre-stroke tile `src`. */
3347
3465
  compositeTile(src, tx, ty, options = {}, paint) {
3348
3466
  const r = this.retouch;
@@ -3403,6 +3521,18 @@ var PaintStrokeSession = class {
3403
3521
  }
3404
3522
  }
3405
3523
  for (const [key, { tx, ty, r }] of regions) {
3524
+ if (this.deep) {
3525
+ const src2 = tileSamples(this.base.tiles.get(key), 4, this.deep, this.base.defaultValue);
3526
+ const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
3527
+ this.touched.add(key);
3528
+ const opts = prev2 ? { into: prev2, region: r } : {};
3529
+ const rt = this.retouch;
3530
+ const paint = rt?.kind === "coverage" ? rt.paint() : null;
3531
+ const d = rt?.kind === "coverage" && paint?.kind === "tone" ? applyToneToDeepTile(stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : applyStrokeToDeepTile(stroke.coverage, src2, tx, ty, this.apply, opts);
3532
+ this.liveDeep.set(key, d);
3533
+ this.live.set(key, { data: proxyOf(d, 4), uniform: null, deep: d });
3534
+ continue;
3535
+ }
3406
3536
  const src = this.base.tiles.get(key)?.data ?? defaultTile(this.base);
3407
3537
  const prev = this.touched.has(key) ? this.live.get(key)?.data : void 0;
3408
3538
  this.touched.add(key);
@@ -3435,7 +3565,8 @@ var PaintStrokeSession = class {
3435
3565
  let changed = false;
3436
3566
  for (const key of this.touched) {
3437
3567
  const live = this.live.get(key);
3438
- const tile = finishTile(live.data, ch, this.base.defaultValue);
3568
+ const deep = this.liveDeep.get(key);
3569
+ const tile = deep ? deepTile(deep, 4, this.base.defaultValue) : finishTile(live.data, ch, this.base.defaultValue);
3439
3570
  const prev = this.base.tiles.get(key);
3440
3571
  if (tile) tiles.set(key, tile);
3441
3572
  else tiles.delete(key);
@@ -3457,9 +3588,36 @@ var PaintStrokeSession = class {
3457
3588
  this.controller._strokeCommit(this.before, this.target.id, this.target.channel, null);
3458
3589
  }
3459
3590
  };
3591
+ function keepDeepLayers(prev, next) {
3592
+ const before = /* @__PURE__ */ new Map();
3593
+ for (const l of flattenLayers(prev)) before.set(l.id, l);
3594
+ let out = next;
3595
+ for (const l of flattenLayers(next)) {
3596
+ const p = before.get(l.id);
3597
+ if (!p || p === l) continue;
3598
+ let layer = l;
3599
+ if (l.type === "pixel" && p.type === "pixel" && l.surface !== p.surface) {
3600
+ const surface = keepDeepSamples(p.surface, l.surface);
3601
+ if (surface !== l.surface) layer = { ...l, surface };
3602
+ }
3603
+ const m = layer.mask;
3604
+ const pm = p.mask;
3605
+ if (m && pm && m.surface !== pm.surface) {
3606
+ const surface = keepDeepSamples(pm.surface, m.surface);
3607
+ if (surface !== m.surface) layer = { ...layer, mask: { ...m, surface } };
3608
+ }
3609
+ if (layer !== l) out = mapLayer(out, l.id, () => layer);
3610
+ }
3611
+ return out;
3612
+ }
3460
3613
  function sameTile(a, b) {
3461
3614
  if (!a || !b) return !a && !b;
3462
3615
  if (a === b) return true;
3616
+ if (a.deep || b.deep) {
3617
+ if (!a.deep || !b.deep || a.deep.constructor !== b.deep.constructor || a.deep.length !== b.deep.length) return false;
3618
+ for (let i = 0; i < a.deep.length; i++) if (a.deep[i] !== b.deep[i]) return false;
3619
+ return true;
3620
+ }
3463
3621
  if (a.uniform !== null || b.uniform !== null) return a.uniform === b.uniform;
3464
3622
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
3465
3623
  return true;
@@ -4086,8 +4244,11 @@ var ImageEditorController = class {
4086
4244
  /** Records one undo step and applies a new stack (and any other state change in `extra`). */
4087
4245
  commitLayers(next, extra, commitToHistory = true) {
4088
4246
  if (commitToHistory) this.recordHistory();
4247
+ const prev = this.state.layers;
4248
+ const depth = this.bitDepth;
4089
4249
  this.state.layers = next;
4090
4250
  extra?.();
4251
+ if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
4091
4252
  if (this.state.activeLayerId && !findLayer(next, this.state.activeLayerId)) {
4092
4253
  this.state.activeLayerId = null;
4093
4254
  this.state.activeTarget = "pixels";
@@ -5350,8 +5511,9 @@ var ImageEditorController = class {
5350
5511
  offset: target.offset
5351
5512
  };
5352
5513
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply);
5353
- if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply);
5354
- return new PaintStrokeSession(this, target, new StrokeCoverage(brush), apply);
5514
+ const depth = target.channel === "pixels" && this.bitDepth !== 8 ? this.bitDepth : null;
5515
+ if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, tool === "dodge" || tool === "burn" ? depth : null);
5516
+ return new PaintStrokeSession(this, target, new StrokeCoverage(brush), apply, depth);
5355
5517
  }
5356
5518
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
5357
5519
  retouchStroke(tool, init, brush, target, apply) {
@@ -5469,8 +5631,11 @@ var ImageEditorController = class {
5469
5631
  }
5470
5632
  /** @internal Commits a finished stroke as one undo step (`before` is the pre-stroke state). */
5471
5633
  _strokeCommit(before, layerId, channel, surface) {
5472
- if (surface) this.state.layers = mapLayer(this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
5473
- else this.state.layers = before.layers;
5634
+ if (surface) {
5635
+ const prev = before.layers;
5636
+ this.state.layers = mapLayer(this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
5637
+ if (this.bitDepth !== 8) this.state.layers = keepDeepLayers(prev, this.state.layers);
5638
+ } else this.state.layers = before.layers;
5474
5639
  if (surface && !this.isApplyingHistory) {
5475
5640
  this.undoStack.push(before);
5476
5641
  if (this.undoStack.length > this.maxHistoryDepth) this.undoStack.shift();
@@ -5545,7 +5710,8 @@ var ImageEditorController = class {
5545
5710
  selection: null,
5546
5711
  offset: target.offset
5547
5712
  };
5548
- const surface = paintCoverageInto(target.surface, coverage, apply, [region]);
5713
+ const depth = target.channel === "pixels" && this.bitDepth !== 8 ? this.bitDepth : null;
5714
+ const surface = paintCoverageInto(target.surface, coverage, apply, [region], depth);
5549
5715
  const next = mapLayer(this.state.layers, target.id, (l) => this.withSurface(l, target.channel, surface));
5550
5716
  this.commitLayers(next);
5551
5717
  return { layerId: target.id, channel: target.channel, bounds: region, dabs: 0 };
@@ -13897,6 +14063,7 @@ export {
13897
14063
  BIT_DEPTH_OPTIONS,
13898
14064
  BLEND_MODES,
13899
14065
  BLUR_FILTER_ID,
14066
+ BODY_SCATTER,
13900
14067
  BRUSH_OPTION_CONTROLS,
13901
14068
  BUILTIN_PROFILES,
13902
14069
  COLOR_MODE_OPTIONS,
@@ -13908,6 +14075,7 @@ export {
13908
14075
  DEFAULT_BLENDER,
13909
14076
  DEFAULT_BRUSH,
13910
14077
  DEFAULT_DEPTH_MASK,
14078
+ DEFAULT_FLOW,
13911
14079
  DEFAULT_GLOBAL_LIGHT,
13912
14080
  DEFAULT_MITER_LIMIT,
13913
14081
  DEFAULT_MIXER,
@@ -13920,12 +14088,25 @@ export {
13920
14088
  DEFAULT_TEXT_STYLE,
13921
14089
  DEFAULT_TRANSFORM,
13922
14090
  DEFAULT_TYPE_TOOL_OPTIONS,
14091
+ DEFAULT_WET_PAPER,
14092
+ DEFAULT_WET_PARAMS,
13923
14093
  DEPTH_MASK_CONTROLS,
13924
14094
  DEVELOP_FILTER_ID,
13925
14095
  DIRECT_GAUSSIAN_MAX_SIGMA,
14096
+ DRY_EPS,
13926
14097
  DabWalker,
13927
14098
  EMPTY_DISTANCE,
13928
14099
  EMPTY_MIXER_LOAD,
14100
+ EX,
14101
+ EY,
14102
+ FLAG_ALIVE,
14103
+ FLAG_BOTTOM,
14104
+ FLAG_LEFT,
14105
+ FLAG_RIGHT,
14106
+ FLAG_TOP,
14107
+ FLAG_WET,
14108
+ FLAT,
14109
+ FREE_INTERVAL,
13929
14110
  FREE_TRANSFORM_CONTENTS,
13930
14111
  FREE_TRANSFORM_FIELDS,
13931
14112
  FREE_TRANSFORM_MODES,
@@ -13933,6 +14114,7 @@ export {
13933
14114
  FreeTransformSession,
13934
14115
  FreeTransformTool,
13935
14116
  GUIDED_FILTER_EPS,
14117
+ HIDE,
13936
14118
  HISTOGRAM_BINS,
13937
14119
  HUE_RANGE_LABELS,
13938
14120
  IDENTITY_MATRIX3,
@@ -13956,10 +14138,14 @@ export {
13956
14138
  LayerCompositor,
13957
14139
  LayerEffectError,
13958
14140
  LayerOperationError,
14141
+ MAX_BATCH,
13959
14142
  MAX_BRUSH_SIZE,
13960
14143
  MAX_EFFECT_REACH,
13961
14144
  MAX_KELVIN,
14145
+ MAX_TILT_ACCEL,
13962
14146
  MAX_TRANSFORM_PIXELS,
14147
+ MAX_WET_LANES,
14148
+ MAX_WET_SLOTS,
13963
14149
  MIN_KELVIN,
13964
14150
  MIRED_PER_TEMPERATURE_UNIT,
13965
14151
  MIXER_DRAIN,
@@ -13968,17 +14154,35 @@ export {
13968
14154
  MIXER_PICKUP_RATE,
13969
14155
  MIXING_MODELS,
13970
14156
  MixerStroke,
14157
+ OPP,
13971
14158
  PAINTERLY_BLEND_MODES,
13972
14159
  PAINT_TOOLS,
14160
+ PAPER_CAPACITY,
13973
14161
  PARAGRAPH_STYLE_FIELDS,
14162
+ PARAM,
14163
+ PARAM_FLOATS,
13974
14164
  PATTERN_BLOCK_KEYS,
13975
14165
  PIGMENT_BANDS,
14166
+ PIGMENT_CHANNELS,
13976
14167
  PIGMENT_LAMBDA_MIN,
13977
14168
  PIGMENT_LAMBDA_STEP,
14169
+ PIGMENT_UNIT,
13978
14170
  PIGMENT_WAVELENGTHS,
14171
+ PLANE,
14172
+ PLANE_BYTES,
13979
14173
  PROOF_PROFILE_OPTIONS,
13980
14174
  PSD_BLEND_KEYS,
13981
14175
  PSD_FILE_ACCEPT,
14176
+ P_D0,
14177
+ P_EDGE,
14178
+ P_FX,
14179
+ P_FY,
14180
+ P_H,
14181
+ P_P0,
14182
+ P_RHO,
14183
+ P_SW,
14184
+ P_UX,
14185
+ P_UY,
13982
14186
  PaintExchange,
13983
14187
  PaintGesture,
13984
14188
  PaintStrokeSession,
@@ -13997,12 +14201,18 @@ export {
13997
14201
  SELECTION_MODE_LABELS,
13998
14202
  SELECTION_MODIFY_OPS,
13999
14203
  SELECTION_TOOLS,
14204
+ SET_PLANES,
14000
14205
  SHADOW_AMBIENT,
14001
14206
  SHAPE_KIND_LABELS,
14002
14207
  SHAPE_OPERATIONS,
14003
14208
  SHAPE_RENDER_MARGIN,
14209
+ SLOT_BYTES,
14210
+ SLOT_PLANES,
14211
+ SLOT_SIDE,
14004
14212
  SMART_RENDER_MARGIN,
14005
14213
  SPOT_HEAL_TYPES,
14214
+ SRGB_TO_LINEAR,
14215
+ STRIP,
14006
14216
  SUPPORTED_ADJUSTMENT_KEYS,
14007
14217
  SelectionGesture,
14008
14218
  ShapeDrawGesture,
@@ -14025,12 +14235,21 @@ export {
14025
14235
  TiledSurface,
14026
14236
  TransformTooLargeError,
14027
14237
  TypeToolGesture,
14238
+ U_MAX,
14028
14239
  VIBRANCE_GREY,
14240
+ W9,
14029
14241
  WARP_GRID_OPTIONS,
14030
14242
  WARP_STYLES,
14031
14243
  WARP_STYLE_LABELS,
14032
14244
  WARP_STYLE_OPTIONS,
14245
+ WET_FLOW_KINDS,
14246
+ WET_PARAM_KEYS,
14247
+ WET_TILE,
14033
14248
  WORKING_SPACE_OPTIONS,
14249
+ WetMedium,
14250
+ WetWorkerPool,
14251
+ WetWorld,
14252
+ WetWorldError,
14034
14253
  XYZ_D50_TO_SRGB,
14035
14254
  ZlibError,
14036
14255
  activeAdjustmentLayers,
@@ -14068,7 +14287,9 @@ export {
14068
14287
  applyRetouchToTile,
14069
14288
  applyShapeOptions,
14070
14289
  applySmartFilters,
14290
+ applyStrokeToDeepTile,
14071
14291
  applyStrokeToTile,
14292
+ applyToneToDeepTile,
14072
14293
  backgroundLayer,
14073
14294
  base64ToBytes,
14074
14295
  baseProjection,
@@ -14095,6 +14316,7 @@ export {
14095
14316
  builtinPatternIds,
14096
14317
  bytesToBase64,
14097
14318
  calculateCropDrag,
14319
+ canShareMemory,
14098
14320
  canvasCompositeOperation,
14099
14321
  canvasToImagePoint,
14100
14322
  caretAt,
@@ -14195,18 +14417,23 @@ export {
14195
14417
  developFilter,
14196
14418
  developFromAdjustments,
14197
14419
  developTarget,
14420
+ dexp,
14198
14421
  dilateMask,
14199
14422
  displayTransform,
14200
14423
  distanceTransform,
14424
+ dlog,
14201
14425
  documentContents,
14202
14426
  documentProfile,
14203
14427
  dodgeBurn,
14204
14428
  dodgeBurnCurve,
14205
14429
  downloadPsd,
14430
+ dpow,
14206
14431
  dragWarpMeshPoint,
14207
14432
  dropPlacement,
14208
14433
  dropZone,
14434
+ dsincos,
14209
14435
  duplicateLayer,
14436
+ edgeBits,
14210
14437
  edgeWidth,
14211
14438
  effectColorHex,
14212
14439
  effectControlChange,
@@ -14227,11 +14454,14 @@ export {
14227
14454
  evalWarpMesh,
14228
14455
  evaluateAdjustmentLayers,
14229
14456
  exchangeRates,
14457
+ expNeg,
14230
14458
  expandCoverage,
14231
14459
  exportPsd,
14232
14460
  extractNormalizedLayerItems,
14233
14461
  featherCoverage,
14234
14462
  fillRect,
14463
+ filmPixel,
14464
+ filmReflectance,
14235
14465
  filterMaskCoverage,
14236
14466
  findAdjustmentControl,
14237
14467
  findLayer,
@@ -14242,6 +14472,7 @@ export {
14242
14472
  flattenLayers,
14243
14473
  flattenPath,
14244
14474
  flipCorners,
14475
+ flowField,
14245
14476
  fontOf,
14246
14477
  formatControlValue,
14247
14478
  fullSelection,
@@ -14319,8 +14550,10 @@ export {
14319
14550
  isSrgb,
14320
14551
  isTransformAnchor,
14321
14552
  isValidWarp,
14553
+ keepDeepSamples,
14322
14554
  kelvinToTemperature,
14323
14555
  keysWeight,
14556
+ latticeViscosity,
14324
14557
  layerBadge,
14325
14558
  layerEffectControls,
14326
14559
  layerEffectFields,
@@ -14349,12 +14582,14 @@ export {
14349
14582
  levelsValue,
14350
14583
  linearSrgbToXy,
14351
14584
  linearToSrgb,
14585
+ linearToSrgb8,
14352
14586
  liveComponent,
14353
14587
  liveShapeForDrag,
14354
14588
  liveShapeSubpaths,
14355
14589
  loadImageEditorDocument,
14356
14590
  loadMixer,
14357
14591
  loadOpenTypeFont,
14592
+ loadWetKernel,
14358
14593
  luma,
14359
14594
  magicWand,
14360
14595
  mapCropHandle,
@@ -14391,6 +14626,7 @@ export {
14391
14626
  normalizeBlender,
14392
14627
  normalizeBrush,
14393
14628
  normalizeFilter,
14629
+ normalizeFlow,
14394
14630
  normalizeLayerEffects,
14395
14631
  normalizeLayerMask,
14396
14632
  normalizeLiveShape,
@@ -14407,11 +14643,15 @@ export {
14407
14643
  normalizeStoredAdjustments,
14408
14644
  normalizeSubpaths,
14409
14645
  normalizeText,
14646
+ normalizeTilt,
14647
+ normalizeWetParams,
14410
14648
  offsetLayer,
14411
14649
  offsetShape,
14412
14650
  offsetSmartObject,
14413
14651
  openPsdFile,
14414
14652
  packRgba,
14653
+ packWetParams,
14654
+ paintPathStroke,
14415
14655
  paragraphRanges,
14416
14656
  parseAdjustmentBlock,
14417
14657
  parseBlend,
@@ -14427,11 +14667,16 @@ export {
14427
14667
  parseVersionedDescriptor,
14428
14668
  patchParagraphStyle,
14429
14669
  patchTextStyle,
14670
+ pathStrokeCoverage,
14671
+ pathStrokeDabs,
14430
14672
  perDabStrength,
14431
14673
  photoFilterMatrix,
14432
14674
  pigment8,
14675
+ pigmentColor,
14676
+ pigmentOf,
14433
14677
  pixelLayerBounds,
14434
14678
  pixelLayers,
14679
+ pixelPigment,
14435
14680
  placeContents,
14436
14681
  placeLayer,
14437
14682
  placementAt,
@@ -14546,6 +14791,7 @@ export {
14546
14791
  setSmartFilterMask,
14547
14792
  setSmartFiltersEnabled,
14548
14793
  setSmartPlacement,
14794
+ shadeTile,
14549
14795
  shapeAsPixelLayer,
14550
14796
  shapeFromAnnotation,
14551
14797
  shapeGeometryBounds,
@@ -14567,10 +14813,12 @@ export {
14567
14813
  spotHealPixels,
14568
14814
  spotHealWindow,
14569
14815
  srgb8ToLab,
14816
+ srgbByteToLinear,
14570
14817
  srgbDecode,
14571
14818
  srgbEncode,
14572
14819
  srgbToLinear,
14573
14820
  standardBlendMode,
14821
+ stepSlotTs,
14574
14822
  styleAt,
14575
14823
  sumHistograms,
14576
14824
  surfaceBytes,
@@ -14644,6 +14892,8 @@ export {
14644
14892
  warpPresetMesh,
14645
14893
  warpSurface,
14646
14894
  wbMatrix,
14895
+ wetSimdSupported,
14896
+ wetSupport,
14647
14897
  whiteBalanceFromSample,
14648
14898
  whiteBalanceMatrix,
14649
14899
  withFilterMaskSurface,