@pixerate/editor 0.103.0 → 0.105.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/THIRD_PARTY_NOTICES.md +2 -0
- package/dist/{chunk-NQLQ2JOI.js → chunk-4X5MIVCE.js} +1155 -295
- package/dist/chunk-4X5MIVCE.js.map +1 -0
- package/dist/{chunk-VSMM7B3P.cjs → chunk-ZID226ZG.cjs} +1169 -309
- package/dist/chunk-ZID226ZG.cjs.map +1 -0
- package/dist/{compositor-CTMU-B1t.d.cts → compositor-Bc3PNP3C.d.cts} +1 -1
- package/dist/{compositor-B1ZrKR89.d.ts → compositor-BsYYllvR.d.ts} +1 -1
- package/dist/{export-X9rY79p0.d.cts → export-_m3Es4ru.d.cts} +19 -4
- package/dist/{export-BLpMyCYg.d.ts → export-iMrop3Jm.d.ts} +19 -4
- package/dist/image-editor/index.cjs +523 -539
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +16 -8
- package/dist/image-editor/index.d.ts +16 -8
- package/dist/image-editor/index.js +37 -53
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{mixer-DGcH6HLu.d.cts → mixer-C1M1Nua_.d.cts} +1 -1
- package/dist/{mixer-DG_9Yu2W.d.ts → mixer-Cu5a9Bzd.d.ts} +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint-editor/index.cjs +1531 -128
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +461 -14
- package/dist/paint-editor/index.d.ts +461 -14
- package/dist/paint-editor/index.js +1479 -76
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/{surface-AfHCH7BR.d.cts → surface-BBJN9wxg.d.cts} +1 -1
- package/dist/{surface-AfHCH7BR.d.ts → surface-BBJN9wxg.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +14 -5
- package/skills/pixerate-paint-editor/SKILL.md +49 -8
- package/dist/chunk-NQLQ2JOI.js.map +0 -1
- package/dist/chunk-VSMM7B3P.cjs.map +0 -1
package/dist/raster/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BlendMode } from '../surface-
|
|
2
|
-
export {
|
|
3
|
-
import { j as LayerEffects, g as GlobalLight, W as PatternTile, i as LayerEffect, v as EffectContour, J as GradientStyle } from '../compositor-
|
|
4
|
-
export { B as BevelContour, m as BevelEmbossEffect, n as BevelStyle, o as BevelTechnique, p as BevelTexture, q as ColorOverlayEffect, r as CompositeCallOptions, s as CompositeStats, C as CompositorLayer, k as CompositorOptions, aA as CompositorProfile, t as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, u as DropShadowEffect, w as EffectFill, x as EffectGradient, E as EffectPattern, y as EffectPatternRef, z as GlowTechnique, A as GradientColorStop, F as GradientOpacityStop, H as GradientOverlayEffect, G as GroupBlendMode, aB as GroupIn, K as INTERPOLATIONS, M as InnerGlowEffect, N as InnerShadowEffect, I as Interpolation, O as LAYER_EFFECT_KINDS, P as LayerEffectError, l as LayerEffectKind, h as LayerLocation, L as LayerLocks, Q as MAX_EFFECT_REACH, S as MAX_TRANSFORM_PIXELS, T as OuterGlowEffect, U as PatternOverlayEffect, V as PatternPlacement, aC as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aD as RasterNode, b as RasterPixelLayer, d as RasterSources, X as ResampleOptions, Y as SatinEffect, Z as StrokeEffect, _ as StrokePosition, $ as TransformTooLargeError, a0 as blendTile, a1 as builtinPattern, a2 as builtinPatternIds, a3 as changedTiles, a4 as compositeSurfaceOver, a5 as defaultEffectGradient, a6 as defaultLayerEffect, a7 as effectColorHex, a8 as effectReach, a9 as effectsFingerprint, aa as effectsMargin, ab as effectsScale, ac as findLayer, ad as flattenLayers, ae as hasActiveEffects, af as hashNoise, ag as insertLayer, ah as isInterpolation, ai as isLayerEffectKind, aj as isLayerLocked, ak as keysWeight, al as layerEffectFields, am as layerEffectLabel, an as mapLayer, ao as mergeLayerEffect, ap as newEffectId, aq as normalizeLayerEffects, ar as parseEffectColor, as as reduceSurface, at as scaleLayerEffect, au as transformSurface, av as transformedBounds, aw as validateEffectGradient, ax as validateLayerEffect, ay as validateLayerEffects, az as warpSurface } from '../compositor-
|
|
1
|
+
import { B as BlendMode } from '../surface-BBJN9wxg.cjs';
|
|
2
|
+
export { b as BLEND_MODES, d as BlendModeInfo, M as MaskSurface, P as PixelSurface, R as RasterRect, e as Rgb, f as Rgba, S as SurfaceDraft, g as TILE, h as TILE_SHIFT, c as Tile, T as TileKey, a as TiledSurface, j as blendChannel, k as blendImageData, l as blendLum, m as blendPixel, n as blendRgb, o as canvasCompositeOperation, p as collectTiles, q as contentBounds, r as emptySurface, s as fillRect, t as finishTile, i as isBlendMode, u as isSeparableBlendMode, v as mixPigment8, w as mixPigmentRgb, x as normalizeBlendMode, y as packRgba, z as readPixel, A as readRegion, C as setLum, D as solidSurface, E as surfaceBytes, F as surfaceFromPixels, G as surfacesEqual, H as tileCoord, I as tileKey, J as tileRect, K as tilesInRect, L as translateSurface, N as uniformTile, O as writeRegion } from '../surface-BBJN9wxg.cjs';
|
|
3
|
+
import { j as LayerEffects, g as GlobalLight, W as PatternTile, i as LayerEffect, v as EffectContour, J as GradientStyle } from '../compositor-Bc3PNP3C.cjs';
|
|
4
|
+
export { B as BevelContour, m as BevelEmbossEffect, n as BevelStyle, o as BevelTechnique, p as BevelTexture, q as ColorOverlayEffect, r as CompositeCallOptions, s as CompositeStats, C as CompositorLayer, k as CompositorOptions, aA as CompositorProfile, t as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, u as DropShadowEffect, w as EffectFill, x as EffectGradient, E as EffectPattern, y as EffectPatternRef, z as GlowTechnique, A as GradientColorStop, F as GradientOpacityStop, H as GradientOverlayEffect, G as GroupBlendMode, aB as GroupIn, K as INTERPOLATIONS, M as InnerGlowEffect, N as InnerShadowEffect, I as Interpolation, O as LAYER_EFFECT_KINDS, P as LayerEffectError, l as LayerEffectKind, h as LayerLocation, L as LayerLocks, Q as MAX_EFFECT_REACH, S as MAX_TRANSFORM_PIXELS, T as OuterGlowEffect, U as PatternOverlayEffect, V as PatternPlacement, aC as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aD as RasterNode, b as RasterPixelLayer, d as RasterSources, X as ResampleOptions, Y as SatinEffect, Z as StrokeEffect, _ as StrokePosition, $ as TransformTooLargeError, a0 as blendTile, a1 as builtinPattern, a2 as builtinPatternIds, a3 as changedTiles, a4 as compositeSurfaceOver, a5 as defaultEffectGradient, a6 as defaultLayerEffect, a7 as effectColorHex, a8 as effectReach, a9 as effectsFingerprint, aa as effectsMargin, ab as effectsScale, ac as findLayer, ad as flattenLayers, ae as hasActiveEffects, af as hashNoise, ag as insertLayer, ah as isInterpolation, ai as isLayerEffectKind, aj as isLayerLocked, ak as keysWeight, al as layerEffectFields, am as layerEffectLabel, an as mapLayer, ao as mergeLayerEffect, ap as newEffectId, aq as normalizeLayerEffects, ar as parseEffectColor, as as reduceSurface, at as scaleLayerEffect, au as transformSurface, av as transformedBounds, aw as validateEffectGradient, ax as validateLayerEffect, ay as validateLayerEffects, az as warpSurface } from '../compositor-Bc3PNP3C.cjs';
|
|
5
5
|
import '../types-CwMPoRMU.cjs';
|
|
6
6
|
|
|
7
7
|
/** Above this σ a Gaussian is approximated by three box passes (cost independent of σ). */
|
package/dist/raster/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BlendMode } from '../surface-
|
|
2
|
-
export {
|
|
3
|
-
import { j as LayerEffects, g as GlobalLight, W as PatternTile, i as LayerEffect, v as EffectContour, J as GradientStyle } from '../compositor-
|
|
4
|
-
export { B as BevelContour, m as BevelEmbossEffect, n as BevelStyle, o as BevelTechnique, p as BevelTexture, q as ColorOverlayEffect, r as CompositeCallOptions, s as CompositeStats, C as CompositorLayer, k as CompositorOptions, aA as CompositorProfile, t as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, u as DropShadowEffect, w as EffectFill, x as EffectGradient, E as EffectPattern, y as EffectPatternRef, z as GlowTechnique, A as GradientColorStop, F as GradientOpacityStop, H as GradientOverlayEffect, G as GroupBlendMode, aB as GroupIn, K as INTERPOLATIONS, M as InnerGlowEffect, N as InnerShadowEffect, I as Interpolation, O as LAYER_EFFECT_KINDS, P as LayerEffectError, l as LayerEffectKind, h as LayerLocation, L as LayerLocks, Q as MAX_EFFECT_REACH, S as MAX_TRANSFORM_PIXELS, T as OuterGlowEffect, U as PatternOverlayEffect, V as PatternPlacement, aC as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aD as RasterNode, b as RasterPixelLayer, d as RasterSources, X as ResampleOptions, Y as SatinEffect, Z as StrokeEffect, _ as StrokePosition, $ as TransformTooLargeError, a0 as blendTile, a1 as builtinPattern, a2 as builtinPatternIds, a3 as changedTiles, a4 as compositeSurfaceOver, a5 as defaultEffectGradient, a6 as defaultLayerEffect, a7 as effectColorHex, a8 as effectReach, a9 as effectsFingerprint, aa as effectsMargin, ab as effectsScale, ac as findLayer, ad as flattenLayers, ae as hasActiveEffects, af as hashNoise, ag as insertLayer, ah as isInterpolation, ai as isLayerEffectKind, aj as isLayerLocked, ak as keysWeight, al as layerEffectFields, am as layerEffectLabel, an as mapLayer, ao as mergeLayerEffect, ap as newEffectId, aq as normalizeLayerEffects, ar as parseEffectColor, as as reduceSurface, at as scaleLayerEffect, au as transformSurface, av as transformedBounds, aw as validateEffectGradient, ax as validateLayerEffect, ay as validateLayerEffects, az as warpSurface } from '../compositor-
|
|
1
|
+
import { B as BlendMode } from '../surface-BBJN9wxg.js';
|
|
2
|
+
export { b as BLEND_MODES, d as BlendModeInfo, M as MaskSurface, P as PixelSurface, R as RasterRect, e as Rgb, f as Rgba, S as SurfaceDraft, g as TILE, h as TILE_SHIFT, c as Tile, T as TileKey, a as TiledSurface, j as blendChannel, k as blendImageData, l as blendLum, m as blendPixel, n as blendRgb, o as canvasCompositeOperation, p as collectTiles, q as contentBounds, r as emptySurface, s as fillRect, t as finishTile, i as isBlendMode, u as isSeparableBlendMode, v as mixPigment8, w as mixPigmentRgb, x as normalizeBlendMode, y as packRgba, z as readPixel, A as readRegion, C as setLum, D as solidSurface, E as surfaceBytes, F as surfaceFromPixels, G as surfacesEqual, H as tileCoord, I as tileKey, J as tileRect, K as tilesInRect, L as translateSurface, N as uniformTile, O as writeRegion } from '../surface-BBJN9wxg.js';
|
|
3
|
+
import { j as LayerEffects, g as GlobalLight, W as PatternTile, i as LayerEffect, v as EffectContour, J as GradientStyle } from '../compositor-BsYYllvR.js';
|
|
4
|
+
export { B as BevelContour, m as BevelEmbossEffect, n as BevelStyle, o as BevelTechnique, p as BevelTexture, q as ColorOverlayEffect, r as CompositeCallOptions, s as CompositeStats, C as CompositorLayer, k as CompositorOptions, aA as CompositorProfile, t as ContourPoint, D as DEFAULT_GLOBAL_LIGHT, u as DropShadowEffect, w as EffectFill, x as EffectGradient, E as EffectPattern, y as EffectPatternRef, z as GlowTechnique, A as GradientColorStop, F as GradientOpacityStop, H as GradientOverlayEffect, G as GroupBlendMode, aB as GroupIn, K as INTERPOLATIONS, M as InnerGlowEffect, N as InnerShadowEffect, I as Interpolation, O as LAYER_EFFECT_KINDS, P as LayerEffectError, l as LayerEffectKind, h as LayerLocation, L as LayerLocks, Q as MAX_EFFECT_REACH, S as MAX_TRANSFORM_PIXELS, T as OuterGlowEffect, U as PatternOverlayEffect, V as PatternPlacement, aC as PixelFilterSpec, c as RasterCompositor, a as RasterGroupLayer, R as RasterLayer, e as RasterLayerBase, f as RasterMask, aD as RasterNode, b as RasterPixelLayer, d as RasterSources, X as ResampleOptions, Y as SatinEffect, Z as StrokeEffect, _ as StrokePosition, $ as TransformTooLargeError, a0 as blendTile, a1 as builtinPattern, a2 as builtinPatternIds, a3 as changedTiles, a4 as compositeSurfaceOver, a5 as defaultEffectGradient, a6 as defaultLayerEffect, a7 as effectColorHex, a8 as effectReach, a9 as effectsFingerprint, aa as effectsMargin, ab as effectsScale, ac as findLayer, ad as flattenLayers, ae as hasActiveEffects, af as hashNoise, ag as insertLayer, ah as isInterpolation, ai as isLayerEffectKind, aj as isLayerLocked, ak as keysWeight, al as layerEffectFields, am as layerEffectLabel, an as mapLayer, ao as mergeLayerEffect, ap as newEffectId, aq as normalizeLayerEffects, ar as parseEffectColor, as as reduceSurface, at as scaleLayerEffect, au as transformSurface, av as transformedBounds, aw as validateEffectGradient, ax as validateLayerEffect, ay as validateLayerEffects, az as warpSurface } from '../compositor-BsYYllvR.js';
|
|
5
5
|
import '../types-CwMPoRMU.js';
|
|
6
6
|
|
|
7
7
|
/** Above this σ a Gaussian is approximated by three box passes (cost independent of σ). */
|
|
@@ -190,4 +190,4 @@ declare function collectTiles(surface: TiledSurface, into: Set<Tile>): void;
|
|
|
190
190
|
/** True when two surfaces hold the same pixels (cheap when they share tiles). */
|
|
191
191
|
declare function surfacesEqual(a: TiledSurface, b: TiledSurface): boolean;
|
|
192
192
|
|
|
193
|
-
export { readRegion as A, type BlendMode as B, setLum as C, solidSurface as D, surfaceBytes as E, surfaceFromPixels as F, surfacesEqual as G, tileCoord as H, tileKey as I, tileRect as J, tilesInRect as K, translateSurface as L, type MaskSurface as M, uniformTile as N, writeRegion as O, type PixelSurface as P, type RasterRect as R, SurfaceDraft as S, type TileKey as T, TiledSurface as a,
|
|
193
|
+
export { readRegion as A, type BlendMode as B, setLum as C, solidSurface as D, surfaceBytes as E, surfaceFromPixels as F, surfacesEqual as G, tileCoord as H, tileKey as I, tileRect as J, tilesInRect as K, translateSurface as L, type MaskSurface as M, uniformTile as N, writeRegion as O, type PixelSurface as P, type RasterRect as R, SurfaceDraft as S, type TileKey as T, TiledSurface as a, BLEND_MODES as b, type Tile as c, type BlendModeInfo as d, type Rgb as e, type Rgba as f, TILE as g, TILE_SHIFT as h, isBlendMode as i, blendChannel as j, blendImageData as k, blendLum as l, blendPixel as m, blendRgb as n, canvasCompositeOperation as o, collectTiles as p, contentBounds as q, emptySurface as r, fillRect as s, finishTile as t, isSeparableBlendMode as u, mixPigment8 as v, mixPigmentRgb as w, normalizeBlendMode as x, packRgba as y, readPixel as z };
|
|
@@ -190,4 +190,4 @@ declare function collectTiles(surface: TiledSurface, into: Set<Tile>): void;
|
|
|
190
190
|
/** True when two surfaces hold the same pixels (cheap when they share tiles). */
|
|
191
191
|
declare function surfacesEqual(a: TiledSurface, b: TiledSurface): boolean;
|
|
192
192
|
|
|
193
|
-
export { readRegion as A, type BlendMode as B, setLum as C, solidSurface as D, surfaceBytes as E, surfaceFromPixels as F, surfacesEqual as G, tileCoord as H, tileKey as I, tileRect as J, tilesInRect as K, translateSurface as L, type MaskSurface as M, uniformTile as N, writeRegion as O, type PixelSurface as P, type RasterRect as R, SurfaceDraft as S, type TileKey as T, TiledSurface as a,
|
|
193
|
+
export { readRegion as A, type BlendMode as B, setLum as C, solidSurface as D, surfaceBytes as E, surfaceFromPixels as F, surfacesEqual as G, tileCoord as H, tileKey as I, tileRect as J, tilesInRect as K, translateSurface as L, type MaskSurface as M, uniformTile as N, writeRegion as O, type PixelSurface as P, type RasterRect as R, SurfaceDraft as S, type TileKey as T, TiledSurface as a, BLEND_MODES as b, type Tile as c, type BlendModeInfo as d, type Rgb as e, type Rgba as f, TILE as g, TILE_SHIFT as h, isBlendMode as i, blendChannel as j, blendImageData as k, blendLum as l, blendPixel as m, blendRgb as n, canvasCompositeOperation as o, collectTiles as p, contentBounds as q, emptySurface as r, fillRect as s, finishTile as t, isSeparableBlendMode as u, mixPigment8 as v, mixPigmentRgb as w, normalizeBlendMode as x, packRgba as y, readPixel as z };
|
package/package.json
CHANGED
|
@@ -172,8 +172,9 @@ batching.
|
|
|
172
172
|
### Photoshop files
|
|
173
173
|
|
|
174
174
|
1. **Inspect before opening.** `inspect_psd` lists every layer with the type it would become and
|
|
175
|
-
a status: `mapped` (held exactly), `approximated` (type,
|
|
176
|
-
|
|
175
|
+
a status: `mapped` (held exactly), `approximated` (type, fill and shape layers come in as their
|
|
176
|
+
stored pixels; linked smart objects as their stored pixels; Photoshop smart filters other than
|
|
177
|
+
Box Blur are kept but not drawn; Dissolve becomes Normal; effects with gradient midpoints or
|
|
177
178
|
smoothness, noise gradients, glow jitter, legacy bevels or patterns missing from the file are
|
|
178
179
|
drawn approximately) or
|
|
179
180
|
`dropped` (Brightness/Contrast, Exposure, Channel Mixer, Gradient Map, Selective Color and
|
|
@@ -187,12 +188,20 @@ batching.
|
|
|
187
188
|
and 32-bit files are converted to 8-bit RGB, and ICC profiles are ignored; the warnings say
|
|
188
189
|
so. Afterwards work with `list_layers` as usual: there is no Background source image, every
|
|
189
190
|
pixel comes from the layers.
|
|
190
|
-
4.
|
|
191
|
+
4. **Smart objects come in live**: embedded contents (a PSB opens as a nested document you can
|
|
192
|
+
edit with `edit_smart_object_contents`, a PNG as raster contents), the placement and warp, the
|
|
193
|
+
smart filters and the filter mask; the layer shows Photoshop's own pixels until you change it.
|
|
194
|
+
JPEG, TIFF and SVG contents are decoded only in a browser, so elsewhere such a smart object
|
|
195
|
+
cannot be transformed (the error says so). Photoshop filters we do not model stay in the list
|
|
196
|
+
(kind `psd`): hide, reorder, re-blend or remove them, and `export_psd` writes them back.
|
|
197
|
+
5. **`export_psd` writes the stack as it is**, in the source frame: crop and rotation are not
|
|
191
198
|
applied, layer filters and depth masks are baked, annotation layers are rasterized (only in
|
|
192
199
|
a browser). Effects are written as Photoshop layer styles: an effects block opened from a PSD
|
|
193
200
|
goes back byte for byte while its effects are unchanged, and the patterns effects use (the
|
|
194
201
|
built-in ones too) are embedded. Only the first outer glow, inner glow, bevel, satin and
|
|
195
|
-
pattern overlay of a layer fit in a PSD.
|
|
202
|
+
pattern overlay of a layer fit in a PSD. Smart objects are written as smart objects (an
|
|
203
|
+
unchanged one byte for byte); a Develop smart filter has no Photoshop filter and is left out of
|
|
204
|
+
the list (the pixels still show it). Read its `warnings` and pass them on. The file comes back as base64 (`data`).
|
|
196
205
|
|
|
197
206
|
## Best practices
|
|
198
207
|
|
|
@@ -277,7 +286,7 @@ batching.
|
|
|
277
286
|
| `get_image_info` | Read the geometry: source `image` size, `crop` box (source pixels, or null), `rotation` degrees, `flipH` / `flipV`, the `output` size after crop and rotation, the layer count and `canUndo` / `canRedo`. Call before cropping or selecting so coordinates are right. |
|
|
278
287
|
| `get_histogram` | Judge exposure numerically: per channel and luminance `mean`, `p1` and `p99` (0..255), and `clipping` percent at pure black and white per channel. Reads the last render, so call `render_preview` first. `bins` (16, 32, 64 or 256) adds the counts. Cheaper than another image for checking a tonal change. |
|
|
279
288
|
| `render_preview` | See the edited image (crop, adjustments, layers, annotations) as a PNG, or with `layerId` one layer alone. `maxSide` 16..2048 px, default 512. Images cost tokens: render after a group of edits, use 512 for overall look and 1024+ to judge clipping, edges and masks. Fails in environments without rendering. |
|
|
280
|
-
| `inspect_psd` | Read a PSD / PSB (`data` base64) without opening it: size, `depth`, `colorMode`, `resolution`, every layer bottom first with `psdKind`, the `type` it would become and `status` (`mapped`, `approximated`, `dropped`) with `notes`, and the import `warnings`. Call before `import_psd`. |
|
|
289
|
+
| `inspect_psd` | Read a PSD / PSB (`data` base64) without opening it: size, `depth`, `colorMode`, `resolution`, every layer bottom first with `psdKind`, the `type` it would become (`smart` for smart objects) and `status` (`mapped`, `approximated`, `dropped`) with `notes`, and the import `warnings`. Call before `import_psd`. |
|
|
281
290
|
| `export_psd` | Save the document as an 8-bit RGB PSD (PSB above 30000 px) with layers, groups, adjustment layers and masks. Returns `data` (base64), `size` in bytes, `psb` and `warnings` (crop or rotation not applied, filters and depth masks baked, annotations rasterized or left out, Pigment blends written as Normal). Changes nothing. |
|
|
282
291
|
| `get_transform_frame` | Before a transform: what it would move (`content`, `moved`: pixels, mask, selection), its `frame` (document bounds of the content), `corners` (top-left, top-right, bottom-right, bottom-left) and `center`. `meshColumns` / `meshRows` also return an identity warp `mesh` over the frame to edit for `warp_layer`. Changes nothing. |
|
|
283
292
|
| `get_smart_object` | Read a smart object: `contents` (`id` shared by linked instances, `name`, `kind` raster or document, `width` / `height`, `decoded`, `fileType`, `linkedPath`, `instances`), `placement` (`corners`, `warp` in contents px, `interpolation`, and when `affine` the `scaleX` / `scaleY` in percent of the contents, `rotate`, `skewX`, `center`, `bounds`) and `smartFilters` (`enabled`, `filters` bottom to top with ids, settings, `blend`, `opacity`; kind `psd` is a Photoshop filter kept but not drawn; the filter `mask`). Call before changing a smart object. |
|
|
@@ -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 Rebelle) through its agent tools - canvas and paper (generated grain, depth, colour, families from cold pressed watercolour to canvas and gesso), layers, dry-media brushes (pencil, pastel, charcoal, airbrush, marker, ink, erasers, blender, smudge, Mixer Brush) with pressure, tilt, barrel rotation and velocity, the brush library, strokes as data that replay and vary,
|
|
3
|
+
description: How to make a picture in the Pixerate paint editor (natural media in the spirit of Painter and Rebelle) through its agent tools - canvas and paper (generated grain, depth, colour, families from cold pressed watercolour to canvas and gesso), layers, dry-media brushes (pencil, pastel, charcoal, airbrush, marker, ink, erasers, blender, smudge, Mixer Brush) with pressure, tilt, barrel rotation and velocity, the brush library, strokes as data that replay and vary, mirror and kaleidoscope painting, perspective guides, tracing and reference images, colour harmonies, swatches, a mixing pad and pigment mixing, previews and PNG, JPEG, WebP, PSD and JSON output. Use when asked to paint, sketch, draw, shade, block in, texture with paper grain, mix colours, paint symmetric or in perspective, trace an image, or when paint_stroke, set_paper, replay_strokes, set_symmetry or mix_colors are available.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Paint editor
|
|
@@ -21,6 +21,10 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
21
21
|
- **Strokes are data.** Every stroke is recorded (brush, colour, raw points, seed, symmetry
|
|
22
22
|
copies) and gets a `strokeId`. `replay_strokes` paints recorded strokes again, exactly or
|
|
23
23
|
varied. That is the main way an agent should make many similar marks.
|
|
24
|
+
- **Guides** are editor state saved with the document: a symmetry guide makes every stroke paint
|
|
25
|
+
its mirror or kaleidoscope copies (one stroke), a perspective guide snaps strokes to lines
|
|
26
|
+
towards one to three vanishing points, a tracing image sits under the paint (never exported)
|
|
27
|
+
and can supply stroke colours, and reference images float beside the canvas to pick from.
|
|
24
28
|
- **Undo**: one tool call that changes the painting is one undo step (`undo_paint`). Brush,
|
|
25
29
|
colour, view, hand and the Mixer Brush load are editor state, not undo steps.
|
|
26
30
|
|
|
@@ -36,17 +40,25 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
36
40
|
`fill_layer` gives a ground colour (flat) or a tonal layer that catches the grain
|
|
37
41
|
(`grain` 0.6..1, `pressure` 0.2..0.6). Paint large masses with a big soft pastel or airbrush
|
|
38
42
|
in a few long `paint_stroke`s rather than many small ones.
|
|
39
|
-
4. **
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
4. **Plan and mix colours before painting.** `color_harmony` gives a palette around a key colour
|
|
44
|
+
(on the painter's red-yellow-blue wheel by default). `mix_colors` predicts what paints mixed
|
|
45
|
+
in given parts look like (Kubelka-Munk: blue and yellow make green, white tints rather than
|
|
46
|
+
greys); the mixing pad (`mixing_pad_stroke`, `pick_mixing_pad_color`) mixes by hand with a
|
|
47
|
+
palette knife. Keep chosen colours as swatches (`add_swatch`). Use the result as the stroke
|
|
48
|
+
`color`; `set_color` makes it the default.
|
|
42
49
|
5. **Refine** with smaller brushes on new layers: pencil and ink for line, charcoal for value,
|
|
43
50
|
blender or smudge to soften edges, the Mixer Brush to blend wet into wet.
|
|
44
|
-
6. **
|
|
51
|
+
6. **Let the guides multiply your marks.** `set_symmetry` (mirror for faces and vases,
|
|
52
|
+
kaleidoscope for mandalas and ornaments) paints every copy from one stroke;
|
|
53
|
+
`set_perspective_guide` plus `paint_stroke` with `snapToPerspective` lays converging lines for
|
|
54
|
+
buildings and roads. To copy an image's composition and colours, `set_tracing_image` with
|
|
55
|
+
`sampleColors` and paint over it.
|
|
56
|
+
7. **Repeat and vary instead of drawing every mark.** Paint one good stroke, then
|
|
45
57
|
`replay_strokes` it with `dx` / `dy`, `rotate`, `scale`, `flipX`, `color`, `brushId` and
|
|
46
58
|
`repeat` for hatching, grass, foliage, rows, fans or spirals, in one undo step.
|
|
47
|
-
|
|
59
|
+
8. **Check** with `render_preview` after each block of work, not after each stroke.
|
|
48
60
|
`pick_color` reads exact values. Undo what made it worse.
|
|
49
|
-
|
|
61
|
+
9. **Deliver**: `export_image` (PNG, or JPEG / WebP in a browser), `export_psd` for Photoshop,
|
|
50
62
|
`save_document` to keep the painting with its strokes.
|
|
51
63
|
|
|
52
64
|
## Best practices
|
|
@@ -123,17 +135,41 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
123
135
|
| `get_mixer_brush` | Read what the Mixer Brush carries: `reservoir`, `amount` left, `pickup`. |
|
|
124
136
|
| `load_mixer_brush` | Fill the Mixer Brush reservoir with a colour (keeps its pickup). |
|
|
125
137
|
| `clean_mixer_brush` | Empty the pickup well (and with `emptyReservoir` the paint). |
|
|
138
|
+
| `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. |
|
|
139
|
+
| `list_swatches` | Read the swatches (index, colour, name). |
|
|
140
|
+
| `add_swatch` | Keep a colour as a swatch (saved with the document). |
|
|
141
|
+
| `remove_swatch` | Remove a swatch by `index`. |
|
|
142
|
+
| `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. |
|
|
143
|
+
| `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. |
|
|
144
|
+
| `clear_mixing_pad` | Wipe the pad. |
|
|
145
|
+
| `render_mixing_pad` | See the pad as a PNG. |
|
|
126
146
|
|
|
127
147
|
### Painting and strokes
|
|
128
148
|
|
|
129
149
|
| Tool | Use |
|
|
130
150
|
| --- | --- |
|
|
131
|
-
| `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`. Returns `layerId`, `bounds`, `dabs`, `strokeId` and for the mixer engine its `mixerLoad`. Refused on locked, hidden or group layers, with the fix in the message. |
|
|
151
|
+
| `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 the mixer engine its `mixerLoad`. Refused on locked, hidden or group layers, with the fix in the message. |
|
|
132
152
|
| `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. |
|
|
133
153
|
| `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. |
|
|
134
154
|
| `undo_paint` | Undo the last step. Returns what was undone and what is next. |
|
|
135
155
|
| `redo_paint` | Redo the step just undone. |
|
|
136
156
|
|
|
157
|
+
### Guides
|
|
158
|
+
|
|
159
|
+
| Tool | Use |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| `get_guides` | Read the symmetry guide (with how many copies a stroke paints), the perspective guide, the tracing image and the reference images. |
|
|
162
|
+
| `set_symmetry` | `mode` off, vertical, horizontal, dual, diagonal or kaleidoscope (`segments` 2..32, `mirror`), `center` (document px, default the canvas centre), `rotation`. Every stroke after it paints its copies as one stroke; recorded strokes keep their copies when replayed. |
|
|
163
|
+
| `set_perspective_guide` | One to three vanishing `points` (document px, may be off the canvas), `enabled`, `snap`. Pen strokes snap to the guide line through their start that best matches their direction (one-point also keeps horizontals and verticals, two-point verticals); `paint_stroke` snaps only with `snapToPerspective`. |
|
|
164
|
+
| `set_tracing_image` | Put a PNG (`png` base64 or data URL) under the paint, fitted to the canvas or at `rect`, at `opacity` (default 0.35), with `sampleColors` to take stroke colours from it. View only: never exported. |
|
|
165
|
+
| `update_tracing_image` | Change the tracing image's `opacity`, `visible`, `sampleColors` or `rect`. |
|
|
166
|
+
| `clear_tracing_image` | Remove the tracing image. |
|
|
167
|
+
| `add_reference_image` | Add a floating reference PNG (`name`, panel `x`, `y`, `displayWidth`). Returns its id and size. |
|
|
168
|
+
| `list_reference_images` | Read the reference images: id, name, size, placement, visibility. |
|
|
169
|
+
| `update_reference_image` | Move, resize, rename, show or hide a reference panel. |
|
|
170
|
+
| `remove_reference_image` | Remove a reference image. |
|
|
171
|
+
| `pick_reference_color` | Read a reference image's colour at its own pixel `x`, `y`; `setColor` makes it the paint colour. |
|
|
172
|
+
|
|
137
173
|
### View, input and output
|
|
138
174
|
|
|
139
175
|
| Tool | Use |
|
|
@@ -158,5 +194,10 @@ is never part of a layer. Coordinates are document pixels, (0, 0) top-left, y do
|
|
|
158
194
|
and two strokes on the same spot catch the same peaks.
|
|
159
195
|
- **Big soft brushes at full flow look flat.** Lower `flow` (airbrush 0.05..0.15) and build up.
|
|
160
196
|
- **JPEG and WebP need a browser**; in Node use PNG. Exports never upscale (`scale` ≤ 1).
|
|
197
|
+
- **Symmetry stays on until you turn it off.** Set `mode: "off"` after the symmetric part, or
|
|
198
|
+
every later stroke is mirrored too.
|
|
199
|
+
- **The tracing image is not in exports or previews of the painting alone**; paint over it on a
|
|
200
|
+
layer. Turn `sampleColors` off before painting your own colours, or strokes without `color`
|
|
201
|
+
keep taking its colours.
|
|
161
202
|
- **Recorded strokes are kept in saved documents**; `save_document` with `strokes: false` when
|
|
162
203
|
only the pixels matter (smaller JSON).
|