@pixerate/editor 0.129.0 → 0.132.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/animation-editor/index.cjs +55 -55
- package/dist/animation-editor/index.d.cts +5 -5
- package/dist/animation-editor/index.d.ts +5 -5
- package/dist/animation-editor/index.js +2 -2
- package/dist/{bezier-DP4NnJp3.d.ts → bezier-0IHDCvv_.d.ts} +1 -1
- package/dist/{bezier-CvgQiYRg.d.cts → bezier-oCBfrGDG.d.cts} +1 -1
- package/dist/canvas/index.d.cts +7 -7
- package/dist/canvas/index.d.ts +7 -7
- package/dist/{chunk-XLUYXUBD.cjs → chunk-55UEZIU4.cjs} +119 -90
- package/dist/chunk-55UEZIU4.cjs.map +1 -0
- package/dist/{chunk-A6KHMKI4.js → chunk-ECVI5QRE.js} +2 -2
- package/dist/{chunk-F7Q2NE2Y.js → chunk-G5FX56KX.js} +39 -10
- package/dist/{chunk-F7Q2NE2Y.js.map → chunk-G5FX56KX.js.map} +1 -1
- package/dist/{chunk-ROZFX4QI.js → chunk-IEYXYMRQ.js} +556 -13
- package/dist/chunk-IEYXYMRQ.js.map +1 -0
- package/dist/{chunk-BEGEWQHD.cjs → chunk-OYPJGGF3.cjs} +36 -36
- package/dist/{chunk-BEGEWQHD.cjs.map → chunk-OYPJGGF3.cjs.map} +1 -1
- package/dist/{chunk-ORE334I6.cjs → chunk-YYJKIESX.cjs} +619 -76
- package/dist/chunk-YYJKIESX.cjs.map +1 -0
- package/dist/effects/index.d.cts +4 -4
- package/dist/effects/index.d.ts +4 -4
- package/dist/{export-DotEEyXj.d.ts → export-ByJvAvR7.d.ts} +26 -4
- package/dist/{export-Cbr9IqpJ.d.cts → export-CfAogLEr.d.cts} +1 -1
- package/dist/{export-ClPKUB-v.d.ts → export-Crl82sbE.d.ts} +1 -1
- package/dist/{export-DRzNhrdx.d.cts → export-D-gkjBkB.d.cts} +26 -4
- package/dist/{helpers-CPWcK504.d.ts → helpers-BCd2-PAR.d.ts} +67 -3
- package/dist/{helpers-C5aAd44p.d.cts → helpers-CoIeXQnW.d.cts} +67 -3
- package/dist/image-editor/index.cjs +775 -723
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +8 -8
- package/dist/image-editor/index.d.ts +8 -8
- package/dist/image-editor/index.js +59 -7
- package/dist/image-editor/index.js.map +1 -1
- package/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/{opentype-BOewaGQx.d.cts → opentype-BDahNRTe.d.cts} +2 -2
- package/dist/{opentype-sQrF3Ry1.d.ts → opentype-BQFEvy-t.d.ts} +2 -2
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.d.cts +5 -5
- package/dist/paint-editor/index.d.ts +5 -5
- package/dist/paint-editor/index.js +2 -2
- package/dist/{pathfinder-CnkW7zLI.d.cts → pathfinder-01ZgAwqV.d.cts} +1 -1
- package/dist/{pathfinder-BwJx0_zM.d.ts → pathfinder-DaVdT8jq.d.ts} +1 -1
- package/dist/{pool-CTrtciaN.d.ts → pool-D2A3WTt9.d.ts} +1 -1
- package/dist/{pool-C7GtrL34.d.cts → pool-D6a45MoE.d.cts} +1 -1
- package/dist/{svg-C4LlFnEw.d.cts → svg-CcDz7Zq2.d.cts} +2 -2
- package/dist/{svg-CUzZa0EO.d.ts → svg-DELNVerw.d.ts} +2 -2
- package/dist/{tools-BpCmUNxb.d.cts → tools-BFvkFnRj.d.cts} +1 -1
- package/dist/{tools-AugT22z3.d.ts → tools-D7ws-OKL.d.ts} +1 -1
- package/dist/vector/index.cjs +1149 -1017
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +106 -10
- package/dist/vector/index.d.ts +106 -10
- package/dist/vector/index.js +142 -10
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +4 -4
- package/dist/video-editor/index.d.ts +4 -4
- package/dist/{warp-CIsO617e.d.ts → warp-2N9wkOkL.d.ts} +2 -2
- package/dist/{warp-D62N_5VK.d.cts → warp-DErXW5rz.d.cts} +2 -2
- package/package.json +2 -2
- package/skills/pixerate-image-editor/SKILL.md +6 -2
- package/skills/pixerate-image-editor/references/color-management.md +1 -1
- package/skills/pixerate-image-editor/references/photoshop-files.md +2 -2
- package/skills/pixerate-image-editor/references/retouching.md +9 -1
- package/skills/pixerate-vector/SKILL.md +18 -1
- package/skills/pixerate-vector/references/commands.md +20 -0
- package/dist/chunk-ORE334I6.cjs.map +0 -1
- package/dist/chunk-ROZFX4QI.js.map +0 -1
- package/dist/chunk-XLUYXUBD.cjs.map +0 -1
- /package/dist/{chunk-A6KHMKI4.js.map → chunk-ECVI5QRE.js.map} +0 -0
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
unionBounds,
|
|
19
19
|
vectorGradientPoints,
|
|
20
20
|
widthProfileAt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IEYXYMRQ.js";
|
|
22
22
|
import {
|
|
23
23
|
segmentLength,
|
|
24
24
|
segmentParamAtLength,
|
|
@@ -750,4 +750,4 @@ export {
|
|
|
750
750
|
interpolateVectorPaths,
|
|
751
751
|
evaluateVectorPathKeyframes
|
|
752
752
|
};
|
|
753
|
-
//# sourceMappingURL=chunk-
|
|
753
|
+
//# sourceMappingURL=chunk-ECVI5QRE.js.map
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
textRectPath,
|
|
126
126
|
translateMatrix,
|
|
127
127
|
warpPresetMesh
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-IEYXYMRQ.js";
|
|
129
129
|
import {
|
|
130
130
|
bezierPathBounds,
|
|
131
131
|
outlineStroke,
|
|
@@ -9359,6 +9359,16 @@ function toRgbaDeep(set) {
|
|
|
9359
9359
|
};
|
|
9360
9360
|
const planes = set.color.map((p) => raw(p, cmyk ? 1 : 0));
|
|
9361
9361
|
const alpha = raw(set.alpha, 1);
|
|
9362
|
+
if (depth === 16 && cmyk && set.cmykToRgb16) {
|
|
9363
|
+
const ink = new Uint16Array(n * 4);
|
|
9364
|
+
const out2 = new Uint16Array(n * 4);
|
|
9365
|
+
for (let i = 0, o = 0; i < n; i++, o += 4) {
|
|
9366
|
+
for (let c = 0; c < 4; c++) ink[o + c] = Math.round((1 - (planes[c] ? planes[c](i) : 1)) * 65535);
|
|
9367
|
+
out2[o + 3] = Math.round(clamp012(alpha(i)) * 65535);
|
|
9368
|
+
}
|
|
9369
|
+
set.cmykToRgb16(ink, out2);
|
|
9370
|
+
return out2;
|
|
9371
|
+
}
|
|
9362
9372
|
if (depth === 16) {
|
|
9363
9373
|
const out2 = new Uint16Array(n * 4);
|
|
9364
9374
|
const q2 = (v) => Math.round(clamp012(v) * 65535);
|
|
@@ -9752,9 +9762,10 @@ function recordPixels(ctx, rec, name) {
|
|
|
9752
9762
|
color: planes.slice(0, ctx.colorCount),
|
|
9753
9763
|
alpha: planes[ctx.colorCount],
|
|
9754
9764
|
palette: ctx.palette,
|
|
9755
|
-
cmykToRgb: ctx.cmykToRgb
|
|
9765
|
+
cmykToRgb: ctx.cmykToRgb,
|
|
9766
|
+
cmykToRgb16: ctx.cmykToRgb16
|
|
9756
9767
|
};
|
|
9757
|
-
const deep = set.cmykToRgb ? null : toRgbaDeep(set);
|
|
9768
|
+
const deep = set.cmykToRgb && !set.cmykToRgb16 ? null : toRgbaDeep(set);
|
|
9758
9769
|
if (deep) return surfaceFromDeepPixels({ width, height, data: deep }, 4, rec.rect.left, rec.rect.top);
|
|
9759
9770
|
return surfaceFromPixels({ width, height, data: toRgba8(set) }, 4, rec.rect.left, rec.rect.top);
|
|
9760
9771
|
}
|
|
@@ -9772,7 +9783,7 @@ function recordMask(ctx, rec, name) {
|
|
|
9772
9783
|
if (width && height && !ctx.skipPixels) {
|
|
9773
9784
|
const plane = decodeOr(ctx, rec, id, name);
|
|
9774
9785
|
const depth = ctx.file.header.depth;
|
|
9775
|
-
if (plane && (depth === 16 || depth === 32)
|
|
9786
|
+
if (plane && (depth === 16 || depth === 32)) surface = surfaceFromDeepPixels({ width, height, data: toMaskDeep(plane, width, height, depth) }, 1, rect.left, rect.top, def);
|
|
9776
9787
|
else if (plane) surface = surfaceFromPixels({ width, height, data: toMask8(plane, width, height, depth) }, 1, rect.left, rect.top, def);
|
|
9777
9788
|
}
|
|
9778
9789
|
const mask = { surface, defaultValue: def };
|
|
@@ -10164,9 +10175,10 @@ function mergedLayer(ctx) {
|
|
|
10164
10175
|
color: Array.from({ length: cc }, (_, i) => plane(i)),
|
|
10165
10176
|
alpha: hasAlpha ? plane(cc) : void 0,
|
|
10166
10177
|
palette: ctx.palette,
|
|
10167
|
-
cmykToRgb: ctx.cmykToRgb
|
|
10178
|
+
cmykToRgb: ctx.cmykToRgb,
|
|
10179
|
+
cmykToRgb16: ctx.cmykToRgb16
|
|
10168
10180
|
};
|
|
10169
|
-
const deep = hasAlpha || set.cmykToRgb ? null : toRgbaDeep(set);
|
|
10181
|
+
const deep = hasAlpha || set.cmykToRgb && !set.cmykToRgb16 ? null : toRgbaDeep(set);
|
|
10170
10182
|
let surface;
|
|
10171
10183
|
if (deep) surface = surfaceFromDeepPixels({ width, height, data: deep }, 4);
|
|
10172
10184
|
else {
|
|
@@ -10225,6 +10237,7 @@ function psdToLayers(file, options = {}) {
|
|
|
10225
10237
|
}
|
|
10226
10238
|
const t = Transform.create(src, srgbProfile(), { intent: "relative", bpc: true });
|
|
10227
10239
|
ctx.cmykToRgb = (ink, out) => t.convert8(ink, 4, out, 4, false);
|
|
10240
|
+
if (header.depth === 16) ctx.cmykToRgb16 = (ink, out) => t.convert16(ink, 4, out, 4, false);
|
|
10228
10241
|
}
|
|
10229
10242
|
for (const block of file.globalBlocks) {
|
|
10230
10243
|
if (LINKED_FILE_KEYS.includes(block.key)) {
|
|
@@ -11091,7 +11104,8 @@ function exportPsd(input) {
|
|
|
11091
11104
|
if (width < 1 || height < 1) throw new PsdError("The document is empty.");
|
|
11092
11105
|
const mode = input.colorMode ?? "rgb";
|
|
11093
11106
|
if (mode !== "rgb" && !input.colorPlanes) throw new PsdError(`A ${mode.toUpperCase()} file needs colorPlanes to convert the pixels.`);
|
|
11094
|
-
if (mode !== "rgb" && depth
|
|
11107
|
+
if (mode !== "rgb" && depth === 32) throw new PsdError(`${mode.toUpperCase()} files are written at 8 or 16 bits per channel.`);
|
|
11108
|
+
if (mode !== "rgb" && depth === 16 && !input.colorPlanes16) throw new PsdError(`A 16-bit ${mode.toUpperCase()} file needs colorPlanes16 to convert the pixels.`);
|
|
11095
11109
|
const colorIds = mode === "cmyk" ? [0, 1, 2, 3] : [0, 1, 2];
|
|
11096
11110
|
const colorPlanes = (rgba, n2) => mode === "rgb" ? rgbaToPlanes(rgba, n2).slice(0, 3) : input.colorPlanes(rgba, n2);
|
|
11097
11111
|
const pixelChannels = (rgba, w, h) => {
|
|
@@ -11100,6 +11114,14 @@ function exportPsd(input) {
|
|
|
11100
11114
|
return [rleChannel(CHANNEL_ALPHA, alpha, w, h, psb), ...colorPlanes(rgba, n2).map((p, i) => rleChannel(i, p, w, h, psb))];
|
|
11101
11115
|
};
|
|
11102
11116
|
const surfaceChannels = (surface, bounds) => {
|
|
11117
|
+
if (mode !== "rgb" && depth === 16) {
|
|
11118
|
+
const n2 = bounds.width * bounds.height;
|
|
11119
|
+
const s = readDeepRegion(surface, bounds, 16);
|
|
11120
|
+
const alpha = new Uint16Array(n2);
|
|
11121
|
+
for (let i = 0; i < n2; i++) alpha[i] = s[i * 4 + 3];
|
|
11122
|
+
const planes2 = [alpha, ...input.colorPlanes16(s, n2)];
|
|
11123
|
+
return [CHANNEL_ALPHA, ...colorIds].map((id, i) => rleChannel(id, deepMaskPlane(planes2[i]), bounds.width, bounds.height, psb, 16));
|
|
11124
|
+
}
|
|
11103
11125
|
if (mode !== "rgb") return pixelChannels(readRegion(surface, bounds), bounds.width, bounds.height);
|
|
11104
11126
|
const [r, g, b, a2] = surfacePlanes(surface, bounds, depth);
|
|
11105
11127
|
return [CHANNEL_ALPHA, 0, 1, 2].map((id, i) => rleChannel(id, [a2, r, g, b][i], bounds.width, bounds.height, psb, depth));
|
|
@@ -11304,8 +11326,15 @@ function exportPsd(input) {
|
|
|
11304
11326
|
let planes = [...colorPlanes(matted, n), ...transparent ? [a] : []].map((p) => planeAtDepth(p, depth));
|
|
11305
11327
|
const deep = input.mergedDeep;
|
|
11306
11328
|
if (deep && depth !== 8 && deep.length >= n * 4 && (deep instanceof Uint16Array ? depth === 16 : depth === 32)) {
|
|
11307
|
-
const
|
|
11308
|
-
|
|
11329
|
+
const mattedDeep = matteWhiteDeep(deep);
|
|
11330
|
+
if (mode !== "rgb" && mattedDeep instanceof Uint16Array) {
|
|
11331
|
+
const alpha = new Uint16Array(n);
|
|
11332
|
+
for (let i = 0; i < n; i++) alpha[i] = mattedDeep[i * 4 + 3];
|
|
11333
|
+
planes = [...input.colorPlanes16(mattedDeep, n), ...transparent ? [alpha] : []].map(deepMaskPlane);
|
|
11334
|
+
} else {
|
|
11335
|
+
const dp = deepToPlanes(mattedDeep, n);
|
|
11336
|
+
planes = transparent ? dp : dp.slice(0, 3);
|
|
11337
|
+
}
|
|
11309
11338
|
}
|
|
11310
11339
|
const planeBytes = n * (depth >> 3);
|
|
11311
11340
|
const merged2 = new Uint8Array(planeBytes * planes.length);
|
|
@@ -11736,4 +11765,4 @@ export {
|
|
|
11736
11765
|
smartContentsFile,
|
|
11737
11766
|
exportPsd
|
|
11738
11767
|
};
|
|
11739
|
-
//# sourceMappingURL=chunk-
|
|
11768
|
+
//# sourceMappingURL=chunk-G5FX56KX.js.map
|