@pixerate/editor 0.109.0 → 0.110.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/dist/blending-DXl06NSx.d.ts +486 -0
- package/dist/blending-aOE6Y3UE.d.cts +486 -0
- package/dist/chunk-7VOHOPLW.cjs +1136 -0
- package/dist/chunk-7VOHOPLW.cjs.map +1 -0
- package/dist/{chunk-RE77QYUF.js → chunk-DMRSJBJF.js} +3 -3
- package/dist/chunk-FTBZPI77.cjs +1 -0
- package/dist/chunk-FTBZPI77.cjs.map +1 -0
- package/dist/{chunk-WMBIJCHA.js → chunk-HNS7UHCM.js} +5 -1
- package/dist/{chunk-WMBIJCHA.js.map → chunk-HNS7UHCM.js.map} +1 -1
- package/dist/{chunk-CFMWALBM.js → chunk-LQEEDHOP.js} +2 -2
- package/dist/{chunk-D37BX2ZA.cjs → chunk-MGL4U5WA.cjs} +199 -199
- package/dist/{chunk-D37BX2ZA.cjs.map → chunk-MGL4U5WA.cjs.map} +1 -1
- package/dist/{chunk-AZTZRLDI.cjs → chunk-POGBUYWE.cjs} +92 -92
- package/dist/{chunk-AZTZRLDI.cjs.map → chunk-POGBUYWE.cjs.map} +1 -1
- package/dist/chunk-VKK5VS2T.js +1 -0
- package/dist/{chunk-SZ6KMZNM.cjs → chunk-XIOMMGPD.cjs} +6 -2
- package/dist/chunk-XIOMMGPD.cjs.map +1 -0
- package/dist/{chunk-3PHA3UKI.js → chunk-Z4BC6M74.js} +523 -121
- package/dist/chunk-Z4BC6M74.js.map +1 -0
- package/dist/{export-BLPLaE6Z.d.ts → export-CO2ryu3I.d.ts} +3 -3
- package/dist/{export-DSUc4fQD.d.cts → export-DRiLzP_j.d.cts} +3 -3
- package/dist/image-editor/index.cjs +722 -696
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +9 -9
- package/dist/image-editor/index.d.ts +9 -9
- package/dist/image-editor/index.js +31 -5
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +28 -4
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +3 -89
- package/dist/paint/index.d.ts +3 -89
- package/dist/paint/index.js +27 -3
- package/dist/paint-editor/index.cjs +1052 -286
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +301 -22
- package/dist/paint-editor/index.d.ts +301 -22
- package/dist/paint-editor/index.js +848 -82
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +5 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +2 -2
- package/dist/raster/index.d.ts +2 -2
- package/dist/raster/index.js +4 -2
- package/dist/{render-C-fO_mes.d.cts → render-BEriFuqK.d.cts} +1 -1
- package/dist/{render-OLIMk_v0.d.ts → render-tjzKaik-.d.ts} +1 -1
- package/dist/{surface-CkKOHGPm.d.cts → surface-C8RRg_Bh.d.cts} +109 -1
- package/dist/{surface-CkKOHGPm.d.ts → surface-C8RRg_Bh.d.ts} +109 -1
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +49 -13
- package/dist/chunk-3PHA3UKI.js.map +0 -1
- package/dist/chunk-6BU5WU4R.cjs +0 -1
- package/dist/chunk-6BU5WU4R.cjs.map +0 -1
- package/dist/chunk-HUFQD4CB.cjs +0 -734
- package/dist/chunk-HUFQD4CB.cjs.map +0 -1
- package/dist/chunk-SZ6KMZNM.cjs.map +0 -1
- package/dist/chunk-XYBJKUAU.js +0 -1
- package/dist/mixer-5ziHU8OS.d.cts +0 -282
- package/dist/mixer-DNqiYXYQ.d.ts +0 -282
- /package/dist/{chunk-RE77QYUF.js.map → chunk-DMRSJBJF.js.map} +0 -0
- /package/dist/{chunk-CFMWALBM.js.map → chunk-LQEEDHOP.js.map} +0 -0
- /package/dist/{chunk-XYBJKUAU.js.map → chunk-VKK5VS2T.js.map} +0 -0
package/dist/raster/index.cjs
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
var
|
|
75
|
+
var _chunkPOGBUYWEcjs = require('../chunk-POGBUYWE.cjs');
|
|
76
76
|
require('../chunk-MUUXNRU4.cjs');
|
|
77
77
|
|
|
78
78
|
|
|
@@ -115,8 +115,8 @@ require('../chunk-MUUXNRU4.cjs');
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
var _chunkSZ6KMZNMcjs = require('../chunk-SZ6KMZNM.cjs');
|
|
119
118
|
|
|
119
|
+
var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
|
|
@@ -230,5 +230,7 @@ var _chunkSZ6KMZNMcjs = require('../chunk-SZ6KMZNM.cjs');
|
|
|
230
230
|
|
|
231
231
|
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
exports.BLEND_MODES = _chunkXIOMMGPDcjs.BLEND_MODES; exports.CURVE_LUT_SIZE = _chunkPOGBUYWEcjs.CURVE_LUT_SIZE; exports.DEFAULT_GLOBAL_LIGHT = _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkPOGBUYWEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.INTERPOLATIONS = _chunkPOGBUYWEcjs.INTERPOLATIONS; exports.LAYER_EFFECT_KINDS = _chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS; exports.LayerEffectError = _chunkPOGBUYWEcjs.LayerEffectError; exports.MAX_EFFECT_REACH = _chunkPOGBUYWEcjs.MAX_EFFECT_REACH; exports.MAX_TRANSFORM_PIXELS = _chunkPOGBUYWEcjs.MAX_TRANSFORM_PIXELS; exports.PAINTERLY_BLEND_MODES = _chunkXIOMMGPDcjs.PAINTERLY_BLEND_MODES; exports.PatternPlacement = _chunkPOGBUYWEcjs.PatternPlacement; exports.PatternTile = _chunkPOGBUYWEcjs.PatternTile; exports.RasterCompositor = _chunkPOGBUYWEcjs.RasterCompositor; exports.SHADOW_AMBIENT = _chunkXIOMMGPDcjs.SHADOW_AMBIENT; exports.STROKE_CHAMFER_MAX = _chunkPOGBUYWEcjs.STROKE_CHAMFER_MAX; exports.SurfaceDraft = _chunkXIOMMGPDcjs.SurfaceDraft; exports.TILE = _chunkXIOMMGPDcjs.TILE; exports.TILE_SHIFT = _chunkXIOMMGPDcjs.TILE_SHIFT; exports.TiledSurface = _chunkXIOMMGPDcjs.TiledSurface; exports.TransformTooLargeError = _chunkPOGBUYWEcjs.TransformTooLargeError; exports.ZlibError = _chunkPOGBUYWEcjs.ZlibError; exports.activeEffectItems = _chunkPOGBUYWEcjs.activeEffectItems; exports.adler32 = _chunkPOGBUYWEcjs.adler32; exports.base64ToBytes = _chunkPOGBUYWEcjs.base64ToBytes; exports.blendChannel = _chunkXIOMMGPDcjs.blendChannel; exports.blendImageData = _chunkXIOMMGPDcjs.blendImageData; exports.blendLum = _chunkXIOMMGPDcjs.blendLum; exports.blendPixel = _chunkXIOMMGPDcjs.blendPixel; exports.blendRgb = _chunkXIOMMGPDcjs.blendRgb; exports.blendTile = _chunkPOGBUYWEcjs.blendTile; exports.buildEffectMaps = _chunkPOGBUYWEcjs.buildEffectMaps; exports.builtinPattern = _chunkPOGBUYWEcjs.builtinPattern; exports.builtinPatternIds = _chunkPOGBUYWEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkPOGBUYWEcjs.bytesToBase64; exports.canvasCompositeOperation = _chunkXIOMMGPDcjs.canvasCompositeOperation; exports.changedTiles = _chunkPOGBUYWEcjs.changedTiles; exports.collectTiles = _chunkXIOMMGPDcjs.collectTiles; exports.compositeLayerEffects = _chunkPOGBUYWEcjs.compositeLayerEffects; exports.compositeSurfaceOver = _chunkPOGBUYWEcjs.compositeSurfaceOver; exports.contentBounds = _chunkXIOMMGPDcjs.contentBounds; exports.contourLut = _chunkPOGBUYWEcjs.contourLut; exports.curveLut = _chunkPOGBUYWEcjs.curveLut; exports.decodePng = _chunkPOGBUYWEcjs.decodePng; exports.defaultEffectGradient = _chunkPOGBUYWEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkPOGBUYWEcjs.defaultLayerEffect; exports.deflate = _chunkPOGBUYWEcjs.deflate; exports.deflateRaw = _chunkPOGBUYWEcjs.deflateRaw; exports.effectColorHex = _chunkPOGBUYWEcjs.effectColorHex; exports.effectFillColors = _chunkPOGBUYWEcjs.effectFillColors; exports.effectReach = _chunkPOGBUYWEcjs.effectReach; exports.effectsAreLocal = _chunkPOGBUYWEcjs.effectsAreLocal; exports.effectsFingerprint = _chunkPOGBUYWEcjs.effectsFingerprint; exports.effectsMargin = _chunkPOGBUYWEcjs.effectsMargin; exports.effectsScale = _chunkPOGBUYWEcjs.effectsScale; exports.emptySurface = _chunkXIOMMGPDcjs.emptySurface; exports.encodePng = _chunkPOGBUYWEcjs.encodePng; exports.fillRect = _chunkXIOMMGPDcjs.fillRect; exports.findLayer = _chunkPOGBUYWEcjs.findLayer; exports.finishTile = _chunkXIOMMGPDcjs.finishTile; exports.flattenLayers = _chunkPOGBUYWEcjs.flattenLayers; exports.gaussianBlur = _chunkPOGBUYWEcjs.gaussianBlur; exports.gradientT = _chunkPOGBUYWEcjs.gradientT; exports.hasActiveEffects = _chunkPOGBUYWEcjs.hasActiveEffects; exports.hashNoise = _chunkPOGBUYWEcjs.hashNoise; exports.inflate = _chunkPOGBUYWEcjs.inflate; exports.inflateRaw = _chunkPOGBUYWEcjs.inflateRaw; exports.insertLayer = _chunkPOGBUYWEcjs.insertLayer; exports.isBlendMode = _chunkXIOMMGPDcjs.isBlendMode; exports.isInterpolation = _chunkPOGBUYWEcjs.isInterpolation; exports.isLayerEffectKind = _chunkPOGBUYWEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkPOGBUYWEcjs.isLayerLocked; exports.isPainterlyBlendMode = _chunkXIOMMGPDcjs.isPainterlyBlendMode; exports.isPng = _chunkPOGBUYWEcjs.isPng; exports.isSeparableBlendMode = _chunkXIOMMGPDcjs.isSeparableBlendMode; exports.keysWeight = _chunkPOGBUYWEcjs.keysWeight; exports.layerEffectFields = _chunkPOGBUYWEcjs.layerEffectFields; exports.layerEffectLabel = _chunkPOGBUYWEcjs.layerEffectLabel; exports.mapLayer = _chunkPOGBUYWEcjs.mapLayer; exports.mergeLayerEffect = _chunkPOGBUYWEcjs.mergeLayerEffect; exports.mixPigment8 = _chunkXIOMMGPDcjs.mixPigment8; exports.mixPigmentRgb = _chunkXIOMMGPDcjs.mixPigmentRgb; exports.newEffectId = _chunkPOGBUYWEcjs.newEffectId; exports.normalizeBlendMode = _chunkXIOMMGPDcjs.normalizeBlendMode; exports.normalizeLayerEffects = _chunkPOGBUYWEcjs.normalizeLayerEffects; exports.packRgba = _chunkXIOMMGPDcjs.packRgba; exports.parseDataUrl = _chunkPOGBUYWEcjs.parseDataUrl; exports.parseEffectColor = _chunkPOGBUYWEcjs.parseEffectColor; exports.patchEffectMaps = _chunkPOGBUYWEcjs.patchEffectMaps; exports.pigment8 = _chunkXIOMMGPDcjs.pigment8; exports.pngDataUrl = _chunkPOGBUYWEcjs.pngDataUrl; exports.readPixel = _chunkXIOMMGPDcjs.readPixel; exports.readRegion = _chunkXIOMMGPDcjs.readRegion; exports.reduceSurface = _chunkPOGBUYWEcjs.reduceSurface; exports.renderLayerEffects = _chunkPOGBUYWEcjs.renderLayerEffects; exports.scaleLayerEffect = _chunkPOGBUYWEcjs.scaleLayerEffect; exports.setLum = _chunkXIOMMGPDcjs.setLum; exports.solidSurface = _chunkXIOMMGPDcjs.solidSurface; exports.standardBlendMode = _chunkXIOMMGPDcjs.standardBlendMode; exports.surfaceBytes = _chunkXIOMMGPDcjs.surfaceBytes; exports.surfaceFromPixels = _chunkXIOMMGPDcjs.surfaceFromPixels; exports.surfacesEqual = _chunkXIOMMGPDcjs.surfacesEqual; exports.tileCoord = _chunkXIOMMGPDcjs.tileCoord; exports.tileKey = _chunkXIOMMGPDcjs.tileKey; exports.tileRect = _chunkXIOMMGPDcjs.tileRect; exports.tilesInRect = _chunkXIOMMGPDcjs.tilesInRect; exports.transformSurface = _chunkPOGBUYWEcjs.transformSurface; exports.transformedBounds = _chunkPOGBUYWEcjs.transformedBounds; exports.translateSurface = _chunkXIOMMGPDcjs.translateSurface; exports.uniformTile = _chunkXIOMMGPDcjs.uniformTile; exports.validateEffectGradient = _chunkPOGBUYWEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkPOGBUYWEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkPOGBUYWEcjs.validateLayerEffects; exports.warpSurface = _chunkPOGBUYWEcjs.warpSurface; exports.writeRegion = _chunkXIOMMGPDcjs.writeRegion;
|
|
234
236
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,27MAAC","file":"/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"}
|
package/dist/raster/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { B as BevelContour, o as BevelEmbossEffect, p as BevelStyle, q as BevelTechnique, r as BevelTexture, s as ColorOverlayEffect, t as CompositeCallOptions, u as CompositeStats, C as CompositorLayer, l as CompositorOptions, aD as CompositorProfile, v as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, w as DropShadowEffect, aE as EffectCompositeInput, n as EffectContext, x as EffectContour, E as EffectFill, y as EffectGradient, aF as EffectMaps, h as EffectPattern, z as EffectPatternRef, A as EffectRect, g as GlobalLight, F as GlowTechnique, H as GradientColorStop, J as GradientOpacityStop, K as GradientOverlayEffect, M as GradientStyle, G as GroupBlendMode, aG as GroupIn, N as INTERPOLATIONS, O as InnerGlowEffect, P as InnerShadowEffect, I as Interpolation, Q as LAYER_EFFECT_KINDS, j as LayerEffect, S as LayerEffectError, m as LayerEffectKind, k as LayerEffects, i as LayerLocation, L as LayerLocks, T as MAX_EFFECT_REACH, U as MAX_TRANSFORM_PIXELS, V as OuterGlowEffect, W as PatternOverlayEffect, X as PatternPlacement, Y as PatternTile, aH as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aI as RasterNode, b as RasterPixelLayer, d as RasterSources, Z as ResampleOptions, aJ as STROKE_CHAMFER_MAX, _ as SatinEffect, $ as StrokeEffect, a0 as StrokePosition, a1 as TransformTooLargeError, aK as activeEffectItems, a2 as blendTile, aL as buildEffectMaps, a3 as builtinPattern, a4 as builtinPatternIds, a5 as changedTiles, aM as compositeLayerEffects, a6 as compositeSurfaceOver, aN as contourLut, a7 as defaultEffectGradient, a8 as defaultLayerEffect, a9 as effectColorHex, aO as effectFillColors, aa as effectReach, aP as effectsAreLocal, ab as effectsFingerprint, ac as effectsMargin, ad as effectsScale, ae as findLayer, af as flattenLayers, aQ as gradientT, ag as hasActiveEffects, ah as hashNoise, ai as insertLayer, aj as isInterpolation, ak as isLayerEffectKind, al as isLayerLocked, am as keysWeight, an as layerEffectFields, ao as layerEffectLabel, ap as mapLayer, aq as mergeLayerEffect, ar as newEffectId, as as normalizeLayerEffects, at as parseEffectColor, aR as patchEffectMaps, au as reduceSurface, av as renderLayerEffects, aw as scaleLayerEffect, ax as transformSurface, ay as transformedBounds, az as validateEffectGradient, aA as validateLayerEffect, aB as validateLayerEffects, aC as warpSurface } from '../render-
|
|
1
|
+
export { d as BLEND_MODES, B as BlendMode, c as BlendModeInfo, M as MaskSurface, e as PAINTERLY_BLEND_MODES, b as PixelSurface, R as RasterRect, o as Rgb, p as Rgba, S as SHADOW_AMBIENT, q as SurfaceDraft, r as TILE, t as TILE_SHIFT, f as Tile, T as TileKey, a as TiledSurface, u as blendChannel, v as blendImageData, w as blendLum, x as blendPixel, y as blendRgb, z as canvasCompositeOperation, A as collectTiles, C as contentBounds, E as emptySurface, F as fillRect, G as finishTile, i as isBlendMode, g as isPainterlyBlendMode, H as isSeparableBlendMode, K as mixPigment8, L as mixPigmentRgb, O as normalizeBlendMode, Q as packRgba, U as pigment8, V as readPixel, W as readRegion, Z as setLum, $ as solidSurface, s as standardBlendMode, a0 as surfaceBytes, a1 as surfaceFromPixels, a2 as surfacesEqual, a3 as tileCoord, a4 as tileKey, a5 as tileRect, a6 as tilesInRect, a7 as translateSurface, a8 as uniformTile, a9 as writeRegion } from '../surface-C8RRg_Bh.cjs';
|
|
2
|
+
export { B as BevelContour, o as BevelEmbossEffect, p as BevelStyle, q as BevelTechnique, r as BevelTexture, s as ColorOverlayEffect, t as CompositeCallOptions, u as CompositeStats, C as CompositorLayer, l as CompositorOptions, aD as CompositorProfile, v as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, w as DropShadowEffect, aE as EffectCompositeInput, n as EffectContext, x as EffectContour, E as EffectFill, y as EffectGradient, aF as EffectMaps, h as EffectPattern, z as EffectPatternRef, A as EffectRect, g as GlobalLight, F as GlowTechnique, H as GradientColorStop, J as GradientOpacityStop, K as GradientOverlayEffect, M as GradientStyle, G as GroupBlendMode, aG as GroupIn, N as INTERPOLATIONS, O as InnerGlowEffect, P as InnerShadowEffect, I as Interpolation, Q as LAYER_EFFECT_KINDS, j as LayerEffect, S as LayerEffectError, m as LayerEffectKind, k as LayerEffects, i as LayerLocation, L as LayerLocks, T as MAX_EFFECT_REACH, U as MAX_TRANSFORM_PIXELS, V as OuterGlowEffect, W as PatternOverlayEffect, X as PatternPlacement, Y as PatternTile, aH as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aI as RasterNode, b as RasterPixelLayer, d as RasterSources, Z as ResampleOptions, aJ as STROKE_CHAMFER_MAX, _ as SatinEffect, $ as StrokeEffect, a0 as StrokePosition, a1 as TransformTooLargeError, aK as activeEffectItems, a2 as blendTile, aL as buildEffectMaps, a3 as builtinPattern, a4 as builtinPatternIds, a5 as changedTiles, aM as compositeLayerEffects, a6 as compositeSurfaceOver, aN as contourLut, a7 as defaultEffectGradient, a8 as defaultLayerEffect, a9 as effectColorHex, aO as effectFillColors, aa as effectReach, aP as effectsAreLocal, ab as effectsFingerprint, ac as effectsMargin, ad as effectsScale, ae as findLayer, af as flattenLayers, aQ as gradientT, ag as hasActiveEffects, ah as hashNoise, ai as insertLayer, aj as isInterpolation, ak as isLayerEffectKind, al as isLayerLocked, am as keysWeight, an as layerEffectFields, ao as layerEffectLabel, ap as mapLayer, aq as mergeLayerEffect, ar as newEffectId, as as normalizeLayerEffects, at as parseEffectColor, aR as patchEffectMaps, au as reduceSurface, av as renderLayerEffects, aw as scaleLayerEffect, ax as transformSurface, ay as transformedBounds, az as validateEffectGradient, aA as validateLayerEffect, aB as validateLayerEffects, aC as warpSurface } from '../render-BEriFuqK.cjs';
|
|
3
3
|
import '../types-CwMPoRMU.cjs';
|
|
4
4
|
|
|
5
5
|
/** Above this σ a Gaussian is approximated by three box passes (cost independent of σ). */
|
package/dist/raster/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { B as BevelContour, o as BevelEmbossEffect, p as BevelStyle, q as BevelTechnique, r as BevelTexture, s as ColorOverlayEffect, t as CompositeCallOptions, u as CompositeStats, C as CompositorLayer, l as CompositorOptions, aD as CompositorProfile, v as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, w as DropShadowEffect, aE as EffectCompositeInput, n as EffectContext, x as EffectContour, E as EffectFill, y as EffectGradient, aF as EffectMaps, h as EffectPattern, z as EffectPatternRef, A as EffectRect, g as GlobalLight, F as GlowTechnique, H as GradientColorStop, J as GradientOpacityStop, K as GradientOverlayEffect, M as GradientStyle, G as GroupBlendMode, aG as GroupIn, N as INTERPOLATIONS, O as InnerGlowEffect, P as InnerShadowEffect, I as Interpolation, Q as LAYER_EFFECT_KINDS, j as LayerEffect, S as LayerEffectError, m as LayerEffectKind, k as LayerEffects, i as LayerLocation, L as LayerLocks, T as MAX_EFFECT_REACH, U as MAX_TRANSFORM_PIXELS, V as OuterGlowEffect, W as PatternOverlayEffect, X as PatternPlacement, Y as PatternTile, aH as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aI as RasterNode, b as RasterPixelLayer, d as RasterSources, Z as ResampleOptions, aJ as STROKE_CHAMFER_MAX, _ as SatinEffect, $ as StrokeEffect, a0 as StrokePosition, a1 as TransformTooLargeError, aK as activeEffectItems, a2 as blendTile, aL as buildEffectMaps, a3 as builtinPattern, a4 as builtinPatternIds, a5 as changedTiles, aM as compositeLayerEffects, a6 as compositeSurfaceOver, aN as contourLut, a7 as defaultEffectGradient, a8 as defaultLayerEffect, a9 as effectColorHex, aO as effectFillColors, aa as effectReach, aP as effectsAreLocal, ab as effectsFingerprint, ac as effectsMargin, ad as effectsScale, ae as findLayer, af as flattenLayers, aQ as gradientT, ag as hasActiveEffects, ah as hashNoise, ai as insertLayer, aj as isInterpolation, ak as isLayerEffectKind, al as isLayerLocked, am as keysWeight, an as layerEffectFields, ao as layerEffectLabel, ap as mapLayer, aq as mergeLayerEffect, ar as newEffectId, as as normalizeLayerEffects, at as parseEffectColor, aR as patchEffectMaps, au as reduceSurface, av as renderLayerEffects, aw as scaleLayerEffect, ax as transformSurface, ay as transformedBounds, az as validateEffectGradient, aA as validateLayerEffect, aB as validateLayerEffects, aC as warpSurface } from '../render-
|
|
1
|
+
export { d as BLEND_MODES, B as BlendMode, c as BlendModeInfo, M as MaskSurface, e as PAINTERLY_BLEND_MODES, b as PixelSurface, R as RasterRect, o as Rgb, p as Rgba, S as SHADOW_AMBIENT, q as SurfaceDraft, r as TILE, t as TILE_SHIFT, f as Tile, T as TileKey, a as TiledSurface, u as blendChannel, v as blendImageData, w as blendLum, x as blendPixel, y as blendRgb, z as canvasCompositeOperation, A as collectTiles, C as contentBounds, E as emptySurface, F as fillRect, G as finishTile, i as isBlendMode, g as isPainterlyBlendMode, H as isSeparableBlendMode, K as mixPigment8, L as mixPigmentRgb, O as normalizeBlendMode, Q as packRgba, U as pigment8, V as readPixel, W as readRegion, Z as setLum, $ as solidSurface, s as standardBlendMode, a0 as surfaceBytes, a1 as surfaceFromPixels, a2 as surfacesEqual, a3 as tileCoord, a4 as tileKey, a5 as tileRect, a6 as tilesInRect, a7 as translateSurface, a8 as uniformTile, a9 as writeRegion } from '../surface-C8RRg_Bh.js';
|
|
2
|
+
export { B as BevelContour, o as BevelEmbossEffect, p as BevelStyle, q as BevelTechnique, r as BevelTexture, s as ColorOverlayEffect, t as CompositeCallOptions, u as CompositeStats, C as CompositorLayer, l as CompositorOptions, aD as CompositorProfile, v as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, w as DropShadowEffect, aE as EffectCompositeInput, n as EffectContext, x as EffectContour, E as EffectFill, y as EffectGradient, aF as EffectMaps, h as EffectPattern, z as EffectPatternRef, A as EffectRect, g as GlobalLight, F as GlowTechnique, H as GradientColorStop, J as GradientOpacityStop, K as GradientOverlayEffect, M as GradientStyle, G as GroupBlendMode, aG as GroupIn, N as INTERPOLATIONS, O as InnerGlowEffect, P as InnerShadowEffect, I as Interpolation, Q as LAYER_EFFECT_KINDS, j as LayerEffect, S as LayerEffectError, m as LayerEffectKind, k as LayerEffects, i as LayerLocation, L as LayerLocks, T as MAX_EFFECT_REACH, U as MAX_TRANSFORM_PIXELS, V as OuterGlowEffect, W as PatternOverlayEffect, X as PatternPlacement, Y as PatternTile, aH as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aI as RasterNode, b as RasterPixelLayer, d as RasterSources, Z as ResampleOptions, aJ as STROKE_CHAMFER_MAX, _ as SatinEffect, $ as StrokeEffect, a0 as StrokePosition, a1 as TransformTooLargeError, aK as activeEffectItems, a2 as blendTile, aL as buildEffectMaps, a3 as builtinPattern, a4 as builtinPatternIds, a5 as changedTiles, aM as compositeLayerEffects, a6 as compositeSurfaceOver, aN as contourLut, a7 as defaultEffectGradient, a8 as defaultLayerEffect, a9 as effectColorHex, aO as effectFillColors, aa as effectReach, aP as effectsAreLocal, ab as effectsFingerprint, ac as effectsMargin, ad as effectsScale, ae as findLayer, af as flattenLayers, aQ as gradientT, ag as hasActiveEffects, ah as hashNoise, ai as insertLayer, aj as isInterpolation, ak as isLayerEffectKind, al as isLayerLocked, am as keysWeight, an as layerEffectFields, ao as layerEffectLabel, ap as mapLayer, aq as mergeLayerEffect, ar as newEffectId, as as normalizeLayerEffects, at as parseEffectColor, aR as patchEffectMaps, au as reduceSurface, av as renderLayerEffects, aw as scaleLayerEffect, ax as transformSurface, ay as transformedBounds, az as validateEffectGradient, aA as validateLayerEffect, aB as validateLayerEffects, aC as warpSurface } from '../render-tjzKaik-.js';
|
|
3
3
|
import '../types-CwMPoRMU.js';
|
|
4
4
|
|
|
5
5
|
/** Above this σ a Gaussian is approximated by three box passes (cost independent of σ). */
|
package/dist/raster/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
validateLayerEffect,
|
|
73
73
|
validateLayerEffects,
|
|
74
74
|
warpSurface
|
|
75
|
-
} from "../chunk-
|
|
75
|
+
} from "../chunk-LQEEDHOP.js";
|
|
76
76
|
import "../chunk-GX332W2C.js";
|
|
77
77
|
import {
|
|
78
78
|
BLEND_MODES,
|
|
@@ -100,6 +100,7 @@ import {
|
|
|
100
100
|
mixPigmentRgb,
|
|
101
101
|
normalizeBlendMode,
|
|
102
102
|
packRgba,
|
|
103
|
+
pigment8,
|
|
103
104
|
readPixel,
|
|
104
105
|
readRegion,
|
|
105
106
|
setLum,
|
|
@@ -115,7 +116,7 @@ import {
|
|
|
115
116
|
translateSurface,
|
|
116
117
|
uniformTile,
|
|
117
118
|
writeRegion
|
|
118
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-HNS7UHCM.js";
|
|
119
120
|
export {
|
|
120
121
|
BLEND_MODES,
|
|
121
122
|
CURVE_LUT_SIZE,
|
|
@@ -205,6 +206,7 @@ export {
|
|
|
205
206
|
parseDataUrl,
|
|
206
207
|
parseEffectColor,
|
|
207
208
|
patchEffectMaps,
|
|
209
|
+
pigment8,
|
|
208
210
|
pngDataUrl,
|
|
209
211
|
readPixel,
|
|
210
212
|
readRegion,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BlendMode, R as RasterRect, a as TiledSurface, M as MaskSurface,
|
|
1
|
+
import { B as BlendMode, R as RasterRect, a as TiledSurface, M as MaskSurface, b as PixelSurface, T as TileKey } from './surface-C8RRg_Bh.cjs';
|
|
2
2
|
import { H as Homography, V as Vec2 } from './types-CwMPoRMU.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BlendMode, R as RasterRect, a as TiledSurface, M as MaskSurface,
|
|
1
|
+
import { B as BlendMode, R as RasterRect, a as TiledSurface, M as MaskSurface, b as PixelSurface, T as TileKey } from './surface-C8RRg_Bh.js';
|
|
2
2
|
import { H as Homography, V as Vec2 } from './types-CwMPoRMU.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,3 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pigment-like colour mixing: blue and yellow make green, red and white make pink, as paint does.
|
|
3
|
+
*
|
|
4
|
+
* Each sRGB colour is lifted to a smooth reflectance spectrum, the spectra are mixed with the
|
|
5
|
+
* Kubelka-Munk two-flux model, and the mixed spectrum is turned back into sRGB. Written from the
|
|
6
|
+
* published literature; no third-party code or data:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Spectral uplift.** A colour's reflectance is a sigmoid of a quadratic in wavelength,
|
|
9
|
+
* `R(λ) = s(c₀λ² + c₁λ + c₂)` with `s(z) = ½ + z / 2√(1 + z²)` (Jakob & Hanika, "A
|
|
10
|
+
* Low-Dimensional Function Space for Efficient Spectral Upsampling", Eurographics 2019). The
|
|
11
|
+
* three coefficients are solved per colour with Newton's method so the spectrum reproduces the
|
|
12
|
+
* colour. Spectra are precomputed lazily on a 17³ lattice over sRGB and interpolated
|
|
13
|
+
* trilinearly in *linear* RGB: colour is linear in reflectance, so an interpolated spectrum
|
|
14
|
+
* still reproduces its colour exactly while staying smooth and inside 0..1.
|
|
15
|
+
* 2. **Mixing.** Each spectrum becomes `K/S = (1 − R)² / 2R` per band. Colours mix with the
|
|
16
|
+
* two-constant form `K/S = Σ cᵢSᵢ(K/S)ᵢ / Σ cᵢSᵢ`, where `cᵢ` is the weight times the colour's
|
|
17
|
+
* tinting strength and `Sᵢ` its scattering, taken from its luminance (light paints such as
|
|
18
|
+
* titanium white scatter strongly, dark ones barely). Back to reflectance with
|
|
19
|
+
* `R = 1 + K/S − √((K/S)² + 2·K/S)`.
|
|
20
|
+
* 3. **Back to sRGB.** The spectrum is weighted by the CIE 1931 2° colour-matching functions
|
|
21
|
+
* (the analytic multi-lobe fit of Wyman, Sloan & Shirley, JCGT 2013) under a 6504 K Planckian
|
|
22
|
+
* illuminant, converted to linear sRGB and normalised so a perfect white reflector is exactly
|
|
23
|
+
* white. Analytic curves keep the CIE's own (CC BY-SA) tables out of the package.
|
|
24
|
+
*
|
|
25
|
+
* Everything is plain TypeScript on typed arrays with no DOM: it runs in Node and Workers and is
|
|
26
|
+
* deterministic. Colours are straight sRGB triples in 0..1, as in `@pixerate/editor/raster`.
|
|
27
|
+
*/
|
|
28
|
+
/** An sRGB colour, each channel 0..1 (gamma-encoded, as in CSS). */
|
|
29
|
+
type PigmentRgb = readonly [number, number, number];
|
|
30
|
+
/** Number of spectral bands. */
|
|
31
|
+
declare const PIGMENT_BANDS = 36;
|
|
32
|
+
/** First band's wavelength in nm; bands are 10 nm apart (380..730 nm). */
|
|
33
|
+
declare const PIGMENT_LAMBDA_MIN = 380;
|
|
34
|
+
declare const PIGMENT_LAMBDA_STEP = 10;
|
|
35
|
+
/** Band centre wavelengths in nm. */
|
|
36
|
+
declare const PIGMENT_WAVELENGTHS: Float32Array;
|
|
37
|
+
/**
|
|
38
|
+
* The smooth reflectance spectrum (0..1 per band, `PIGMENT_BANDS` bands from 380 nm in 10 nm
|
|
39
|
+
* steps) of an sRGB colour. `reflectanceToRgb` of the result gives the colour back.
|
|
40
|
+
*/
|
|
41
|
+
declare function rgbToReflectance(r: number, g: number, b: number, out?: Float32Array): Float32Array;
|
|
42
|
+
/** The sRGB colour (0..1, clipped to the gamut) of a reflectance spectrum. */
|
|
43
|
+
declare function reflectanceToRgb(reflectance: ArrayLike<number>, out?: number[]): number[];
|
|
44
|
+
/**
|
|
45
|
+
* A colour prepared for mixing: its K/S spectrum and its weight in a mix. Make one per brush or
|
|
46
|
+
* palette colour with `createPigment` and reuse it (`setPigmentColor`) on hot paths.
|
|
47
|
+
*/
|
|
48
|
+
interface Pigment {
|
|
49
|
+
/** The sRGB colour it was made from (0..1). */
|
|
50
|
+
readonly rgb: [number, number, number];
|
|
51
|
+
/** Tinting strength (default 1): how strongly it colours a mix, relative to its weight. */
|
|
52
|
+
strength: number;
|
|
53
|
+
/** K/S per band. */
|
|
54
|
+
readonly ks: Float32Array;
|
|
55
|
+
/** Scattering from the colour's luminance (floored), before strength. */
|
|
56
|
+
scatter: number;
|
|
57
|
+
}
|
|
58
|
+
interface PigmentOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Tinting strength, > 0 (default 1). A strength of 4 counts each part as four, so a little of
|
|
61
|
+
* a strong dark pigment tints a lot of white. A colour mixed only with itself is unchanged
|
|
62
|
+
* whatever its strength.
|
|
63
|
+
*/
|
|
64
|
+
strength?: number;
|
|
65
|
+
}
|
|
66
|
+
/** Prepares a colour for mixing. */
|
|
67
|
+
declare function createPigment(color: PigmentRgb, options?: PigmentOptions): Pigment;
|
|
68
|
+
/** Re-targets a pigment to another colour without allocating (the per-pixel fast path). */
|
|
69
|
+
declare function setPigmentColor(pigment: Pigment, r: number, g: number, b: number, strength?: number): Pigment;
|
|
70
|
+
/**
|
|
71
|
+
* Mixes colours like paint. `weights` are parts by amount (any non-negative scale; at least one
|
|
72
|
+
* positive). Colours may be sRGB triples (0..1) or prepared pigments (which carry a tinting
|
|
73
|
+
* strength). Returns the mixed sRGB colour (0..1).
|
|
74
|
+
*/
|
|
75
|
+
declare function mixPigments(colors: readonly (PigmentRgb | Pigment)[], weights: readonly number[]): [number, number, number];
|
|
76
|
+
/** Mixes `a` towards `b` like paint: `t = 0` is `a`, `t = 1` is `b`. */
|
|
77
|
+
declare function lerpPigment(a: PigmentRgb | Pigment, b: PigmentRgb | Pigment, t: number): [number, number, number];
|
|
78
|
+
/**
|
|
79
|
+
* The per-dab fast path: mixes two prepared pigments (`t` of `b` into `a`) and writes the sRGB
|
|
80
|
+
* result to `out[offset..offset + 2]`, without allocating. Pair it with `setPigmentColor` for the
|
|
81
|
+
* colour under the brush.
|
|
82
|
+
*/
|
|
83
|
+
declare function lerpPigmentInto(a: Pigment, b: Pigment, t: number, out: {
|
|
84
|
+
[i: number]: number;
|
|
85
|
+
}, offset?: number): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Photoshop blend modes on straight (non-premultiplied) 0..1 colours.
|
|
89
|
+
*
|
|
90
|
+
* Formulas follow the W3C Compositing / ISO 32000 definitions, with Photoshop's variants where
|
|
91
|
+
* they differ (Soft Light, Vivid / Linear / Pin Light, Hard Mix, Linear Burn / Dodge, Subtract,
|
|
92
|
+
* Divide, Darker / Lighter Color), and the hardened `ClipColor` for the non-separable modes.
|
|
93
|
+
*
|
|
94
|
+
* Plus `pigment`, which is not a `B(Cb, Cs)` mode: it replaces the alpha interpolation
|
|
95
|
+
* `(1 − α)·Cb + α·B` with a Kubelka-Munk paint mix of the two colours (see `lerpPigment`).
|
|
96
|
+
*
|
|
97
|
+
* Plus four painterly modes of our own design, which are ordinary `B(Cb, Cs)` modes, so every
|
|
98
|
+
* caller of `blendRgb` / `blendChannel` (the compositor, adjustment layers, effects, brushes) gets
|
|
99
|
+
* them for free: `watercolor` (transparent washes, multiplied per wavelength), `tint` (the source's
|
|
100
|
+
* colour on the backdrop's lightness, gently at the extremes), `highlight` (light added with a
|
|
101
|
+
* soft shoulder) and `shadow` (light taken away, with ambient fill). See `painterlyRgb`.
|
|
102
|
+
*/
|
|
103
|
+
|
|
1
104
|
type BlendMode = 'normal' | 'darken' | 'multiply' | 'color-burn' | 'linear-burn' | 'darker-color' | 'lighten' | 'screen' | 'color-dodge' | 'linear-dodge' | 'lighter-color' | 'overlay' | 'soft-light' | 'hard-light' | 'vivid-light' | 'linear-light' | 'pin-light' | 'hard-mix' | 'difference' | 'exclusion' | 'subtract' | 'divide' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'pigment' | 'watercolor' | 'tint' | 'highlight' | 'shadow';
|
|
2
105
|
interface BlendModeInfo {
|
|
3
106
|
id: BlendMode;
|
|
@@ -56,6 +159,11 @@ declare const SHADOW_AMBIENT = 0.2;
|
|
|
56
159
|
* `out[0..2]`. `t ≥ 1` (or equal colours) is `cs` exactly. Colours are 0..1.
|
|
57
160
|
*/
|
|
58
161
|
declare function mixPigmentRgb(cb: readonly number[], cs: readonly number[], t: number, out?: number[]): number[];
|
|
162
|
+
/**
|
|
163
|
+
* The prepared pigment (K/S spectrum) of an 8-bit colour, from the cache every 8-bit pigment
|
|
164
|
+
* composite shares. Read-only: do not retarget it with `setPigmentColor`.
|
|
165
|
+
*/
|
|
166
|
+
declare function pigment8(r: number, g: number, b: number): Pigment;
|
|
59
167
|
/**
|
|
60
168
|
* {@link mixPigmentRgb} on 8-bit channels, with each colour's spectrum cached: writes the 0..1
|
|
61
169
|
* result to `out[0..2]`. The compositor's and {@link blendImageData}'s per-pixel path.
|
|
@@ -208,4 +316,4 @@ declare function collectTiles(surface: TiledSurface, into: Set<Tile>): void;
|
|
|
208
316
|
/** True when two surfaces hold the same pixels (cheap when they share tiles). */
|
|
209
317
|
declare function surfacesEqual(a: TiledSurface, b: TiledSurface): boolean;
|
|
210
318
|
|
|
211
|
-
export {
|
|
319
|
+
export { solidSurface as $, collectTiles as A, type BlendMode as B, contentBounds as C, createPigment as D, emptySurface as E, fillRect as F, finishTile as G, isSeparableBlendMode as H, lerpPigment as I, lerpPigmentInto as J, mixPigment8 as K, mixPigmentRgb as L, type MaskSurface as M, mixPigments as N, normalizeBlendMode as O, type Pigment as P, packRgba as Q, type RasterRect as R, SHADOW_AMBIENT as S, type TileKey as T, pigment8 as U, readPixel as V, readRegion as W, reflectanceToRgb as X, rgbToReflectance as Y, setLum as Z, setPigmentColor as _, TiledSurface as a, surfaceBytes as a0, surfaceFromPixels as a1, surfacesEqual as a2, tileCoord as a3, tileKey as a4, tileRect as a5, tilesInRect as a6, translateSurface as a7, uniformTile as a8, writeRegion as a9, type PixelSurface as b, type BlendModeInfo as c, BLEND_MODES as d, PAINTERLY_BLEND_MODES as e, type Tile as f, isPainterlyBlendMode as g, PIGMENT_BANDS as h, isBlendMode as i, PIGMENT_LAMBDA_MIN as j, PIGMENT_LAMBDA_STEP as k, PIGMENT_WAVELENGTHS as l, type PigmentOptions as m, type PigmentRgb as n, type Rgb as o, type Rgba as p, SurfaceDraft as q, TILE as r, standardBlendMode as s, TILE_SHIFT as t, blendChannel as u, blendImageData as v, blendLum as w, blendPixel as x, blendRgb as y, canvasCompositeOperation as z };
|
|
@@ -1,3 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pigment-like colour mixing: blue and yellow make green, red and white make pink, as paint does.
|
|
3
|
+
*
|
|
4
|
+
* Each sRGB colour is lifted to a smooth reflectance spectrum, the spectra are mixed with the
|
|
5
|
+
* Kubelka-Munk two-flux model, and the mixed spectrum is turned back into sRGB. Written from the
|
|
6
|
+
* published literature; no third-party code or data:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Spectral uplift.** A colour's reflectance is a sigmoid of a quadratic in wavelength,
|
|
9
|
+
* `R(λ) = s(c₀λ² + c₁λ + c₂)` with `s(z) = ½ + z / 2√(1 + z²)` (Jakob & Hanika, "A
|
|
10
|
+
* Low-Dimensional Function Space for Efficient Spectral Upsampling", Eurographics 2019). The
|
|
11
|
+
* three coefficients are solved per colour with Newton's method so the spectrum reproduces the
|
|
12
|
+
* colour. Spectra are precomputed lazily on a 17³ lattice over sRGB and interpolated
|
|
13
|
+
* trilinearly in *linear* RGB: colour is linear in reflectance, so an interpolated spectrum
|
|
14
|
+
* still reproduces its colour exactly while staying smooth and inside 0..1.
|
|
15
|
+
* 2. **Mixing.** Each spectrum becomes `K/S = (1 − R)² / 2R` per band. Colours mix with the
|
|
16
|
+
* two-constant form `K/S = Σ cᵢSᵢ(K/S)ᵢ / Σ cᵢSᵢ`, where `cᵢ` is the weight times the colour's
|
|
17
|
+
* tinting strength and `Sᵢ` its scattering, taken from its luminance (light paints such as
|
|
18
|
+
* titanium white scatter strongly, dark ones barely). Back to reflectance with
|
|
19
|
+
* `R = 1 + K/S − √((K/S)² + 2·K/S)`.
|
|
20
|
+
* 3. **Back to sRGB.** The spectrum is weighted by the CIE 1931 2° colour-matching functions
|
|
21
|
+
* (the analytic multi-lobe fit of Wyman, Sloan & Shirley, JCGT 2013) under a 6504 K Planckian
|
|
22
|
+
* illuminant, converted to linear sRGB and normalised so a perfect white reflector is exactly
|
|
23
|
+
* white. Analytic curves keep the CIE's own (CC BY-SA) tables out of the package.
|
|
24
|
+
*
|
|
25
|
+
* Everything is plain TypeScript on typed arrays with no DOM: it runs in Node and Workers and is
|
|
26
|
+
* deterministic. Colours are straight sRGB triples in 0..1, as in `@pixerate/editor/raster`.
|
|
27
|
+
*/
|
|
28
|
+
/** An sRGB colour, each channel 0..1 (gamma-encoded, as in CSS). */
|
|
29
|
+
type PigmentRgb = readonly [number, number, number];
|
|
30
|
+
/** Number of spectral bands. */
|
|
31
|
+
declare const PIGMENT_BANDS = 36;
|
|
32
|
+
/** First band's wavelength in nm; bands are 10 nm apart (380..730 nm). */
|
|
33
|
+
declare const PIGMENT_LAMBDA_MIN = 380;
|
|
34
|
+
declare const PIGMENT_LAMBDA_STEP = 10;
|
|
35
|
+
/** Band centre wavelengths in nm. */
|
|
36
|
+
declare const PIGMENT_WAVELENGTHS: Float32Array;
|
|
37
|
+
/**
|
|
38
|
+
* The smooth reflectance spectrum (0..1 per band, `PIGMENT_BANDS` bands from 380 nm in 10 nm
|
|
39
|
+
* steps) of an sRGB colour. `reflectanceToRgb` of the result gives the colour back.
|
|
40
|
+
*/
|
|
41
|
+
declare function rgbToReflectance(r: number, g: number, b: number, out?: Float32Array): Float32Array;
|
|
42
|
+
/** The sRGB colour (0..1, clipped to the gamut) of a reflectance spectrum. */
|
|
43
|
+
declare function reflectanceToRgb(reflectance: ArrayLike<number>, out?: number[]): number[];
|
|
44
|
+
/**
|
|
45
|
+
* A colour prepared for mixing: its K/S spectrum and its weight in a mix. Make one per brush or
|
|
46
|
+
* palette colour with `createPigment` and reuse it (`setPigmentColor`) on hot paths.
|
|
47
|
+
*/
|
|
48
|
+
interface Pigment {
|
|
49
|
+
/** The sRGB colour it was made from (0..1). */
|
|
50
|
+
readonly rgb: [number, number, number];
|
|
51
|
+
/** Tinting strength (default 1): how strongly it colours a mix, relative to its weight. */
|
|
52
|
+
strength: number;
|
|
53
|
+
/** K/S per band. */
|
|
54
|
+
readonly ks: Float32Array;
|
|
55
|
+
/** Scattering from the colour's luminance (floored), before strength. */
|
|
56
|
+
scatter: number;
|
|
57
|
+
}
|
|
58
|
+
interface PigmentOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Tinting strength, > 0 (default 1). A strength of 4 counts each part as four, so a little of
|
|
61
|
+
* a strong dark pigment tints a lot of white. A colour mixed only with itself is unchanged
|
|
62
|
+
* whatever its strength.
|
|
63
|
+
*/
|
|
64
|
+
strength?: number;
|
|
65
|
+
}
|
|
66
|
+
/** Prepares a colour for mixing. */
|
|
67
|
+
declare function createPigment(color: PigmentRgb, options?: PigmentOptions): Pigment;
|
|
68
|
+
/** Re-targets a pigment to another colour without allocating (the per-pixel fast path). */
|
|
69
|
+
declare function setPigmentColor(pigment: Pigment, r: number, g: number, b: number, strength?: number): Pigment;
|
|
70
|
+
/**
|
|
71
|
+
* Mixes colours like paint. `weights` are parts by amount (any non-negative scale; at least one
|
|
72
|
+
* positive). Colours may be sRGB triples (0..1) or prepared pigments (which carry a tinting
|
|
73
|
+
* strength). Returns the mixed sRGB colour (0..1).
|
|
74
|
+
*/
|
|
75
|
+
declare function mixPigments(colors: readonly (PigmentRgb | Pigment)[], weights: readonly number[]): [number, number, number];
|
|
76
|
+
/** Mixes `a` towards `b` like paint: `t = 0` is `a`, `t = 1` is `b`. */
|
|
77
|
+
declare function lerpPigment(a: PigmentRgb | Pigment, b: PigmentRgb | Pigment, t: number): [number, number, number];
|
|
78
|
+
/**
|
|
79
|
+
* The per-dab fast path: mixes two prepared pigments (`t` of `b` into `a`) and writes the sRGB
|
|
80
|
+
* result to `out[offset..offset + 2]`, without allocating. Pair it with `setPigmentColor` for the
|
|
81
|
+
* colour under the brush.
|
|
82
|
+
*/
|
|
83
|
+
declare function lerpPigmentInto(a: Pigment, b: Pigment, t: number, out: {
|
|
84
|
+
[i: number]: number;
|
|
85
|
+
}, offset?: number): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Photoshop blend modes on straight (non-premultiplied) 0..1 colours.
|
|
89
|
+
*
|
|
90
|
+
* Formulas follow the W3C Compositing / ISO 32000 definitions, with Photoshop's variants where
|
|
91
|
+
* they differ (Soft Light, Vivid / Linear / Pin Light, Hard Mix, Linear Burn / Dodge, Subtract,
|
|
92
|
+
* Divide, Darker / Lighter Color), and the hardened `ClipColor` for the non-separable modes.
|
|
93
|
+
*
|
|
94
|
+
* Plus `pigment`, which is not a `B(Cb, Cs)` mode: it replaces the alpha interpolation
|
|
95
|
+
* `(1 − α)·Cb + α·B` with a Kubelka-Munk paint mix of the two colours (see `lerpPigment`).
|
|
96
|
+
*
|
|
97
|
+
* Plus four painterly modes of our own design, which are ordinary `B(Cb, Cs)` modes, so every
|
|
98
|
+
* caller of `blendRgb` / `blendChannel` (the compositor, adjustment layers, effects, brushes) gets
|
|
99
|
+
* them for free: `watercolor` (transparent washes, multiplied per wavelength), `tint` (the source's
|
|
100
|
+
* colour on the backdrop's lightness, gently at the extremes), `highlight` (light added with a
|
|
101
|
+
* soft shoulder) and `shadow` (light taken away, with ambient fill). See `painterlyRgb`.
|
|
102
|
+
*/
|
|
103
|
+
|
|
1
104
|
type BlendMode = 'normal' | 'darken' | 'multiply' | 'color-burn' | 'linear-burn' | 'darker-color' | 'lighten' | 'screen' | 'color-dodge' | 'linear-dodge' | 'lighter-color' | 'overlay' | 'soft-light' | 'hard-light' | 'vivid-light' | 'linear-light' | 'pin-light' | 'hard-mix' | 'difference' | 'exclusion' | 'subtract' | 'divide' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'pigment' | 'watercolor' | 'tint' | 'highlight' | 'shadow';
|
|
2
105
|
interface BlendModeInfo {
|
|
3
106
|
id: BlendMode;
|
|
@@ -56,6 +159,11 @@ declare const SHADOW_AMBIENT = 0.2;
|
|
|
56
159
|
* `out[0..2]`. `t ≥ 1` (or equal colours) is `cs` exactly. Colours are 0..1.
|
|
57
160
|
*/
|
|
58
161
|
declare function mixPigmentRgb(cb: readonly number[], cs: readonly number[], t: number, out?: number[]): number[];
|
|
162
|
+
/**
|
|
163
|
+
* The prepared pigment (K/S spectrum) of an 8-bit colour, from the cache every 8-bit pigment
|
|
164
|
+
* composite shares. Read-only: do not retarget it with `setPigmentColor`.
|
|
165
|
+
*/
|
|
166
|
+
declare function pigment8(r: number, g: number, b: number): Pigment;
|
|
59
167
|
/**
|
|
60
168
|
* {@link mixPigmentRgb} on 8-bit channels, with each colour's spectrum cached: writes the 0..1
|
|
61
169
|
* result to `out[0..2]`. The compositor's and {@link blendImageData}'s per-pixel path.
|
|
@@ -208,4 +316,4 @@ declare function collectTiles(surface: TiledSurface, into: Set<Tile>): void;
|
|
|
208
316
|
/** True when two surfaces hold the same pixels (cheap when they share tiles). */
|
|
209
317
|
declare function surfacesEqual(a: TiledSurface, b: TiledSurface): boolean;
|
|
210
318
|
|
|
211
|
-
export {
|
|
319
|
+
export { solidSurface as $, collectTiles as A, type BlendMode as B, contentBounds as C, createPigment as D, emptySurface as E, fillRect as F, finishTile as G, isSeparableBlendMode as H, lerpPigment as I, lerpPigmentInto as J, mixPigment8 as K, mixPigmentRgb as L, type MaskSurface as M, mixPigments as N, normalizeBlendMode as O, type Pigment as P, packRgba as Q, type RasterRect as R, SHADOW_AMBIENT as S, type TileKey as T, pigment8 as U, readPixel as V, readRegion as W, reflectanceToRgb as X, rgbToReflectance as Y, setLum as Z, setPigmentColor as _, TiledSurface as a, surfaceBytes as a0, surfaceFromPixels as a1, surfacesEqual as a2, tileCoord as a3, tileKey as a4, tileRect as a5, tilesInRect as a6, translateSurface as a7, uniformTile as a8, writeRegion as a9, type PixelSurface as b, type BlendModeInfo as c, BLEND_MODES as d, PAINTERLY_BLEND_MODES as e, type Tile as f, isPainterlyBlendMode as g, PIGMENT_BANDS as h, isBlendMode as i, PIGMENT_LAMBDA_MIN as j, PIGMENT_LAMBDA_STEP as k, PIGMENT_WAVELENGTHS as l, type PigmentOptions as m, type PigmentRgb as n, type Rgb as o, type Rgba as p, SurfaceDraft as q, TILE as r, standardBlendMode as s, TILE_SHIFT as t, blendChannel as u, blendImageData as v, blendLum as w, blendPixel as x, blendRgb as y, canvasCompositeOperation as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pixerate-paint-editor
|
|
3
|
-
description: How to make a picture in the Pixerate paint editor (natural media in the spirit of Painter and
|
|
3
|
+
description: How to make a picture in the Pixerate paint editor (natural media in the spirit of Painter, Rebelle and ArtRage) through its agent tools - canvas and paper (generated grain, depth, families from cold pressed watercolour to canvas), layers with painterly blend modes (watercolor, tint, highlight, shadow), dry-media brushes (pencil, pastel, charcoal, airbrush, marker, ink, erasers) with pressure, tilt, barrel rotation and velocity, blending tools (blender, smudge, Mixer Brush), brush behaviours (pick-up and mix ratios, dirty and multi-coloured brushes), the brush library, strokes that replay and vary, symmetry and perspective guides, tracing and reference images, harmonies, swatches, a mixing pad and pigment mixing, and PNG, JPEG, WebP, PSD and JSON output. Use when asked to paint, sketch, shade, blend, smudge, glaze, mix colours, paint symmetric or in perspective, trace an image, or when paint_stroke, set_paper, replay_strokes or mix_colors are available.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Paint editor
|
|
@@ -14,8 +14,15 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
14
14
|
- **Brushes** are library presets (`list_brushes`): a tip from the shared engine (size,
|
|
15
15
|
hardness, spacing, angle, roundness, opacity, flow, blend), a **grain** response, pen dynamics
|
|
16
16
|
(pressure, tilt, velocity, jitter), a **rotation** mode (`fixed`, `stroke`, `barrel`) and an
|
|
17
|
-
engine: `dab` (most media), `eraser`,
|
|
18
|
-
|
|
17
|
+
engine: `dab` (most media), `eraser`, `mixer` (the Mixer Brush: a reservoir of paint plus paint
|
|
18
|
+
it picks up), `blender` (mixes the colours under and near the tip) or `smudge` (drags paint
|
|
19
|
+
along the stroke).
|
|
20
|
+
- **Behaviour** (`behavior`, dab and mixer brushes) is how a brush treats paint already on the
|
|
21
|
+
canvas: a **pick-up ratio** (how much paint each dab lifts and carries), a **mix ratio** (how
|
|
22
|
+
much of the carried paint goes into what it lays down), **dirty** (keep the carried colour into
|
|
23
|
+
the next stroke) and **multi-colour** (`tip`: several colours side by side across the tip;
|
|
24
|
+
`dab`: the colour changes along the stroke). A Mixer Brush's `mixer.wet` / `mixer.mix` are the
|
|
25
|
+
same two ratios. `get_mixer_brush` reads what the brush carries; `clean_mixer_brush` wipes it.
|
|
19
26
|
- **Grain**: a brush's grain response times the paper's `depth` decides how much light pressure
|
|
20
27
|
skips the valleys. Pencil, pastel and charcoal are grainy; airbrush, marker and ink are not.
|
|
21
28
|
- **Strokes are data.** Every stroke is recorded (brush, colour, raw points, seed, symmetry
|
|
@@ -46,8 +53,13 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
46
53
|
greys); the mixing pad (`mixing_pad_stroke`, `pick_mixing_pad_color`) mixes by hand with a
|
|
47
54
|
palette knife. Keep chosen colours as swatches (`add_swatch`). Use the result as the stroke
|
|
48
55
|
`color`; `set_color` makes it the default.
|
|
49
|
-
5. **Refine** with smaller brushes on new layers: pencil and ink for line, charcoal for value
|
|
50
|
-
|
|
56
|
+
5. **Refine** with smaller brushes on new layers: pencil and ink for line, charcoal for value.
|
|
57
|
+
**Blend** on the layer that holds the paint: `blender` to melt neighbouring colours together
|
|
58
|
+
(pigment mixing, so blue next to yellow goes green), `smudge` / `wet-smudge` to drag paint
|
|
59
|
+
into soft edges and streaks, `mixer-brush` to paint wet into wet, `dirty-round` to paint with
|
|
60
|
+
a brush that picks up and carries colour, `multicolor-flat` for strokes loaded with several
|
|
61
|
+
colours. Glaze with a `watercolor` layer, warm or cool with `tint`, light with `highlight`,
|
|
62
|
+
shade with `shadow`.
|
|
51
63
|
6. **Let the guides multiply your marks.** `set_symmetry` (mirror for faces and vases,
|
|
52
64
|
kaleidoscope for mandalas and ornaments) paints every copy from one stroke;
|
|
53
65
|
`set_perspective_guide` plus `paint_stroke` with `snapToPerspective` lays converging lines for
|
|
@@ -76,8 +88,21 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
76
88
|
between them. Long smooth curves need more points than straight lines.
|
|
77
89
|
- **Use `rotation: "stroke"`** for flat tips (pastel, charcoal, chisel marker) so the mark turns
|
|
78
90
|
with the path; `fixed` for calligraphic nibs.
|
|
79
|
-
- **
|
|
80
|
-
|
|
91
|
+
- **Blending tools**:
|
|
92
|
+
- `blender`: `strength` 0.3..0.6 for soft transitions, `distance` 0.2..0.5 (fraction of the
|
|
93
|
+
tip) for how far colours travel. Keep `mixing: "pigment"` for painterly blends; `rgb`
|
|
94
|
+
blends like a soft blur. Work along an edge in short strokes rather than over everything.
|
|
95
|
+
- `smudge`: `length` near 0.9 drags paint far (long streaks), 0.5 short pushes; `strength`
|
|
96
|
+
0.5..0.8. `mixing: "pigment"` (the `wet-smudge` preset) smears colours into each other like
|
|
97
|
+
wet paint.
|
|
98
|
+
- Mixer Brush: blend with flow 0.3..0.6; at full flow it paints only its own colour.
|
|
99
|
+
- **Pick-up and mix ratios**: `pickup` 0.3..0.7 with `mix` 0.4..0.7 gives a brush that drags
|
|
100
|
+
the colours it crosses into its own; `dirty: true` keeps them for the next stroke (wipe with
|
|
101
|
+
`clean_mixer_brush`). Keep `pickup` 0 for clean, predictable colour.
|
|
102
|
+
- **Multi-colour**: give 2..8 `colors` (or none for the paint and secondary colours). `tip` mode
|
|
103
|
+
with a flat tip and `rotation: "stroke"` paints ribbons; `softness` 0.3..0.7 keeps the stripes
|
|
104
|
+
readable. `dab` mode with `order: "sequence"` and `length` 5..20 walks through a palette;
|
|
105
|
+
`random` for foliage and confetti.
|
|
81
106
|
- **Pigment for paint, multiply for markers**: tip `blend: "pigment"` mixes subtractively on the
|
|
82
107
|
canvas; `multiply` darkens where marker strokes overlap. Pigment layers are written as Normal
|
|
83
108
|
to PSD (the export warns).
|
|
@@ -130,9 +155,9 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
130
155
|
|
|
131
156
|
| Tool | Use |
|
|
132
157
|
| --- | --- |
|
|
133
|
-
| `list_brushes` | Read the library (built-in and saved): id, name, category, engine, size, grain response, rotation, `builtin`; plus the active brush id and whether it is edited. |
|
|
158
|
+
| `list_brushes` | Read the library (built-in and saved): id, name, category, engine, size, grain response, rotation, `wetCapable`, `pickup`, `dirty`, `multicolor` mode, `builtin`; plus the active brush id and whether it is edited. |
|
|
134
159
|
| `get_brush` | Read every setting of a brush, or of the active brush as edited (no `id`). Read before changing a brush you did not build. |
|
|
135
|
-
| `set_brush` | Choose the active brush (`id`) and / or change it: `tip` (size px, hardness, spacing, angle, roundness, opacity, flow, smoothing, pressureSize, pressureOpacity, blend), `grain`, `pressureSmoothing`, `rotation`, `dynamics` (minSize, pressureFlow, tiltSize, tiltRoundness, tiltOpacity, velocitySize, velocityOpacity, jitters, scatter), `mixer`, `loadsColor
|
|
160
|
+
| `set_brush` | Choose the active brush (`id`) and / or change it: `tip` (size px, hardness, spacing, angle, roundness, opacity, flow, smoothing, pressureSize, pressureOpacity, blend), `grain`, `pressureSmoothing`, `rotation`, `dynamics` (minSize, pressureFlow, tiltSize, tiltRoundness, tiltOpacity, velocitySize, velocityOpacity, jitters, scatter), `engine`, `mixer`, `loadsColor`, `behavior` (pickup, mix, dirty, mixing, multicolor: mode, colors, order, length, softness), `blender` (strength, distance, mixing), `smudge` (strength, length, mixing). Editor state. Returns the brush. |
|
|
136
161
|
| `save_brush` | Store the active brush in the user library under `id` (lowercase, digits, dashes) and `name`. Built-in ids are refused. |
|
|
137
162
|
| `remove_brush` | Delete a user brush. Built-in brushes cannot be removed. |
|
|
138
163
|
| `export_brushes` | Get a brush library file (JSON) of `ids`, or of every user brush. |
|
|
@@ -143,12 +168,12 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
143
168
|
|
|
144
169
|
| Tool | Use |
|
|
145
170
|
| --- | --- |
|
|
146
|
-
| `mix_colors` | Predict a
|
|
171
|
+
| `mix_colors` | Predict a mix: `colors` with `weight` parts (and optional tinting `strength`), `model` `pigment` (default, Kubelka-Munk: what pigment blends, the Mixer Brush, pigment blending tools and the pad do) or `rgb` (what normal blending and rgb mixing do). Returns `mixed` by the model plus `pigment` and `rgbLerp` for comparison. Changes nothing. Use it to choose stroke colours. |
|
|
147
172
|
| `set_color` | Set the default paint `color` (and `secondaryColor`). |
|
|
148
173
|
| `pick_color` | Read the colour at `x`, `y`: of the painting with its paper, or of one layer (with alpha). |
|
|
149
|
-
| `get_mixer_brush` | Read what the Mixer Brush
|
|
174
|
+
| `get_mixer_brush` | Read what the brush carries: the Mixer Brush `reservoir` and `amount` left, and `pickup` (paint picked up, kept by dirty brushes). |
|
|
150
175
|
| `load_mixer_brush` | Fill the Mixer Brush reservoir with a colour (keeps its pickup). |
|
|
151
|
-
| `clean_mixer_brush` |
|
|
176
|
+
| `clean_mixer_brush` | Wipe the brush: drop the picked-up paint a dirty brush or the Mixer Brush carries (and with `emptyReservoir` the Mixer Brush paint). |
|
|
152
177
|
| `color_harmony` | Get a harmony (`kind`: complementary, split-complementary, analogous, triadic, tetradic, square, monochromatic) around `color` (default the paint colour), on the `ryb` painter's wheel (default; red ↔ green) or the `rgb` wheel (red ↔ cyan), `spread` degrees for analogous and split. Changes nothing. |
|
|
153
178
|
| `list_swatches` | Read the swatches (index, colour, name). |
|
|
154
179
|
| `add_swatch` | Keep a colour as a swatch (saved with the document). |
|
|
@@ -156,13 +181,18 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
156
181
|
| `mixing_pad_stroke` | Paint on the 360 × 220 mixing pad (pad px): `tool` paint lays `color` with a pigment Mixer Brush, `knife` smears what is there and mixes it as paint. Scratch space, not the painting, no undo. |
|
|
157
182
|
| `pick_mixing_pad_color` | Read the mix on the pad at `x`, `y` (averaged over `radius`, default 3); `setColor` makes it the paint colour. Null where the pad is bare. |
|
|
158
183
|
| `clear_mixing_pad` | Wipe the pad. |
|
|
184
|
+
| `mix_on_pad` | Mix `paints` (`color`, `parts`) on the pad in one call: blobs by parts, knife passes, and a fully mixed Kubelka-Munk core. Optional pile `x`, `y`, `radius`, `passes`, `clear`; `setColor` makes the mix the paint colour. Returns `color` and the pile `bounds`. The quickest way to get a paint colour from named paints. |
|
|
185
|
+
| `save_mixing_pad` | Keep the pad as it is under a `name` (saved with the document). Refused when the pad is empty. Returns the id. |
|
|
186
|
+
| `list_mixing_pads` | Read the kept pads (`id`, `name`). |
|
|
187
|
+
| `load_mixing_pad` | Put a kept pad back (replaces what is on the pad). |
|
|
188
|
+
| `remove_mixing_pad` | Forget a kept pad. |
|
|
159
189
|
| `render_mixing_pad` | See the pad as a PNG. |
|
|
160
190
|
|
|
161
191
|
### Painting and strokes
|
|
162
192
|
|
|
163
193
|
| Tool | Use |
|
|
164
194
|
| --- | --- |
|
|
165
|
-
| `paint_stroke` | Paint one stroke through `points` (document px; `pressure` 0..1, `t` ms, `tiltX` / `tiltY` or `altitude` / `azimuth`, `twist`) with `brushId` (default the active brush), optional per-stroke `brush` changes, `color`, `layerId`, `seed`, `snapToPerspective`. The symmetry guide adds its copies; a sampling tracing image supplies the colour when `color` is missing. Returns `layerId`, `bounds`, `dabs`, `strokeId` and for
|
|
195
|
+
| `paint_stroke` | Paint one stroke through `points` (document px; `pressure` 0..1, `t` ms, `tiltX` / `tiltY` or `altitude` / `azimuth`, `twist`) with `brushId` (default the active brush), optional per-stroke `brush` changes, `color`, `layerId`, `seed`, `snapToPerspective`. The symmetry guide adds its copies; a sampling tracing image supplies the colour when `color` is missing. Returns `layerId`, `bounds`, `dabs`, `strokeId` and, for brushes that pick up paint, `mixerLoad` (what the brush carries now). Refused on locked, hidden or group layers, with the fix in the message. |
|
|
166
196
|
| `list_strokes` | Read the recorded strokes, oldest first (default the last 100): id, layer, brush, colour, point count, seed, bounds. With `ids`, their points too. |
|
|
167
197
|
| `replay_strokes` | Paint recorded `strokeIds` again: exactly, or varied by `dx` / `dy` (px), `rotate` (degrees clockwise), `scale` (brush size follows), `flipX`, `origin`, `pressureScale`, `color`, `brushId`, `layerId`, `repeat` (each copy applies the variation again). One undo step. Returns the new stroke ids, bounds and layers. |
|
|
168
198
|
| `undo_paint` | Undo the last step. Returns what was undone and what is next. |
|
|
@@ -206,6 +236,12 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
206
236
|
has depth 0.
|
|
207
237
|
- **Grain is fixed to the document**, not to the layer: moving content does not move the grain,
|
|
208
238
|
and two strokes on the same spot catch the same peaks.
|
|
239
|
+
- **Blending tools need paint to blend.** Blender and smudge only move what is on the target
|
|
240
|
+
layer: blend on the layer you painted, not on an empty one above it.
|
|
241
|
+
- **A dirty brush stays dirty** across strokes and colour changes until `clean_mixer_brush`.
|
|
242
|
+
Pick-up lifts only paint on the target layer: the paper and other layers lift nothing.
|
|
243
|
+
- **Replays use the recorded load**: a replayed pick-up stroke starts with what the brush carried
|
|
244
|
+
when it was painted, not with the current load.
|
|
209
245
|
- **Big soft brushes at full flow look flat.** Lower `flow` (airbrush 0.05..0.15) and build up.
|
|
210
246
|
- **JPEG and WebP need a browser**; in Node use PNG. Exports never upscale (`scale` ≤ 1).
|
|
211
247
|
- **Symmetry stays on until you turn it off.** Set `mode: "off"` after the symmetric part, or
|