@nodetool-ai/image-nodes 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +94 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/index.d.ts +19 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +19 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/nodes/game.d.ts +68 -0
  8. package/dist/nodes/game.d.ts.map +1 -0
  9. package/dist/nodes/game.js +551 -0
  10. package/dist/nodes/game.js.map +1 -0
  11. package/dist/nodes/gpu-device.d.ts +59 -0
  12. package/dist/nodes/gpu-device.d.ts.map +1 -0
  13. package/dist/nodes/gpu-device.js +144 -0
  14. package/dist/nodes/gpu-device.js.map +1 -0
  15. package/dist/nodes/image-io.d.ts +122 -0
  16. package/dist/nodes/image-io.d.ts.map +1 -0
  17. package/dist/nodes/image-io.js +381 -0
  18. package/dist/nodes/image-io.js.map +1 -0
  19. package/dist/nodes/image.d.ts +649 -0
  20. package/dist/nodes/image.d.ts.map +1 -0
  21. package/dist/nodes/image.js +2827 -0
  22. package/dist/nodes/image.js.map +1 -0
  23. package/dist/nodes/lib-grid.d.ts +19 -0
  24. package/dist/nodes/lib-grid.d.ts.map +1 -0
  25. package/dist/nodes/lib-grid.js +134 -0
  26. package/dist/nodes/lib-grid.js.map +1 -0
  27. package/dist/nodes/lib-image-channel.d.ts +38 -0
  28. package/dist/nodes/lib-image-channel.d.ts.map +1 -0
  29. package/dist/nodes/lib-image-channel.js +55 -0
  30. package/dist/nodes/lib-image-channel.js.map +1 -0
  31. package/dist/nodes/lib-image-color-grading.d.ts +3 -0
  32. package/dist/nodes/lib-image-color-grading.d.ts.map +1 -0
  33. package/dist/nodes/lib-image-color-grading.js +1080 -0
  34. package/dist/nodes/lib-image-color-grading.js.map +1 -0
  35. package/dist/nodes/lib-image-color.d.ts +96 -0
  36. package/dist/nodes/lib-image-color.d.ts.map +1 -0
  37. package/dist/nodes/lib-image-color.js +150 -0
  38. package/dist/nodes/lib-image-color.js.map +1 -0
  39. package/dist/nodes/lib-image-draw.d.ts +4 -0
  40. package/dist/nodes/lib-image-draw.d.ts.map +1 -0
  41. package/dist/nodes/lib-image-draw.js +464 -0
  42. package/dist/nodes/lib-image-draw.js.map +1 -0
  43. package/dist/nodes/lib-image-effects.d.ts +72 -0
  44. package/dist/nodes/lib-image-effects.d.ts.map +1 -0
  45. package/dist/nodes/lib-image-effects.js +123 -0
  46. package/dist/nodes/lib-image-effects.js.map +1 -0
  47. package/dist/nodes/lib-image-enhance.d.ts +3 -0
  48. package/dist/nodes/lib-image-enhance.d.ts.map +1 -0
  49. package/dist/nodes/lib-image-enhance.js +442 -0
  50. package/dist/nodes/lib-image-enhance.js.map +1 -0
  51. package/dist/nodes/lib-image-filter-extras.d.ts +72 -0
  52. package/dist/nodes/lib-image-filter-extras.d.ts.map +1 -0
  53. package/dist/nodes/lib-image-filter-extras.js +110 -0
  54. package/dist/nodes/lib-image-filter-extras.js.map +1 -0
  55. package/dist/nodes/lib-image-filter.d.ts +3 -0
  56. package/dist/nodes/lib-image-filter.d.ts.map +1 -0
  57. package/dist/nodes/lib-image-filter.js +588 -0
  58. package/dist/nodes/lib-image-filter.js.map +1 -0
  59. package/dist/nodes/lib-image-generators.d.ts +71 -0
  60. package/dist/nodes/lib-image-generators.d.ts.map +1 -0
  61. package/dist/nodes/lib-image-generators.js +158 -0
  62. package/dist/nodes/lib-image-generators.js.map +1 -0
  63. package/dist/nodes/lib-image-keyer.d.ts +34 -0
  64. package/dist/nodes/lib-image-keyer.d.ts.map +1 -0
  65. package/dist/nodes/lib-image-keyer.js +61 -0
  66. package/dist/nodes/lib-image-keyer.js.map +1 -0
  67. package/dist/nodes/lib-image-mask.d.ts +47 -0
  68. package/dist/nodes/lib-image-mask.d.ts.map +1 -0
  69. package/dist/nodes/lib-image-mask.js +59 -0
  70. package/dist/nodes/lib-image-mask.js.map +1 -0
  71. package/dist/nodes/lib-image-utils.d.ts +16 -0
  72. package/dist/nodes/lib-image-utils.d.ts.map +1 -0
  73. package/dist/nodes/lib-image-utils.js +61 -0
  74. package/dist/nodes/lib-image-utils.js.map +1 -0
  75. package/dist/nodes/lib-image-warp.d.ts +112 -0
  76. package/dist/nodes/lib-image-warp.d.ts.map +1 -0
  77. package/dist/nodes/lib-image-warp.js +236 -0
  78. package/dist/nodes/lib-image-warp.js.map +1 -0
  79. package/dist/nodes/lib-shader-utils.d.ts +105 -0
  80. package/dist/nodes/lib-shader-utils.d.ts.map +1 -0
  81. package/dist/nodes/lib-shader-utils.js +452 -0
  82. package/dist/nodes/lib-shader-utils.js.map +1 -0
  83. package/dist/nodes/sketch.d.ts +62 -0
  84. package/dist/nodes/sketch.d.ts.map +1 -0
  85. package/dist/nodes/sketch.js +325 -0
  86. package/dist/nodes/sketch.js.map +1 -0
  87. package/package.json +83 -0
@@ -0,0 +1,464 @@
1
+ /// <reference lib="dom" />
2
+ import { BaseNode, registerDeclaredProperty } from "@nodetool-ai/node-sdk";
3
+ import { NODE_AND_BROWSER_PLATFORMS, SERVER_PLATFORMS } from "@nodetool-ai/protocol";
4
+ import { IS_NODE } from "@nodetool-ai/config";
5
+ import * as d from "typegpu/data";
6
+ import { sourcesSolidV1, sourcesGaussianNoiseV1 } from "@nodetool-ai/gpu/pool";
7
+ import { pickImage } from "./lib-image-utils.js";
8
+ import { colorValueToVec4, num, premultiplyVec4, runShaderNode } from "./lib-shader-utils.js";
9
+ import { loadImageBytes, toBase64Ref, toArrayBuffer, loadSharp, SHARP_UNAVAILABLE_MESSAGE } from "./image-io.js";
10
+ import { isObjectLike } from "@nodetool-ai/node-sdk";
11
+ // Clamp a requested output dimension to [1, max]. Guards the low end, the NaN
12
+ // case (via num) and the high end so a programmatic graph can't request an
13
+ // arbitrarily large texture. `max` mirrors the prop metadata's documented max.
14
+ function clampDim(value, fallback, max) {
15
+ return Math.min(max, Math.max(1, Math.round(num(value, fallback))));
16
+ }
17
+ // Escape a value for interpolation into an XML/SVG attribute or text node.
18
+ // Escaping the quotes as well as &<> prevents a value from terminating the
19
+ // attribute string and injecting arbitrary markup into the SVG handed to sharp.
20
+ export function escapeXmlAttr(value) {
21
+ return value
22
+ .replaceAll("&", "&amp;")
23
+ .replaceAll("<", "&lt;")
24
+ .replaceAll(">", "&gt;")
25
+ .replaceAll('"', "&quot;")
26
+ .replaceAll("'", "&apos;");
27
+ }
28
+ // Background (GPU), GaussianNoise (GPU) and RenderText (Canvas in the browser /
29
+ // sharp on Node) all run client-side. The Mask compositor still relies on sharp
30
+ // resize + alpha compositing → Node-only.
31
+ function isServerOnlyDraw(nodeType) {
32
+ return nodeType === "lib.image.Mask";
33
+ }
34
+ // Background + GaussianNoise composite on the GPU (WebGPU in the browser);
35
+ // RenderText uses Canvas2D / sharp and needs no GPU. Only the GPU ones must
36
+ // route to the server when the browser lacks WebGPU — see `tagAsBrowserGpu`.
37
+ function drawRequiresGpu(nodeType) {
38
+ return (nodeType === "lib.image.draw.Background" ||
39
+ nodeType === "lib.image.draw.GaussianNoise");
40
+ }
41
+ function createDrawNode(desc) {
42
+ const serverOnly = isServerOnlyDraw(desc.nodeType);
43
+ const C = class extends BaseNode {
44
+ static nodeType = desc.nodeType;
45
+ static title = desc.title;
46
+ static description = desc.description;
47
+ static inlineFields = desc.inlineFields;
48
+ static inputFields = desc.inputFields;
49
+ static metadataOutputTypes = desc.outputs;
50
+ static platforms = serverOnly
51
+ ? SERVER_PLATFORMS
52
+ : NODE_AND_BROWSER_PLATFORMS;
53
+ static requiresGpu = drawRequiresGpu(desc.nodeType)
54
+ ? true
55
+ : undefined;
56
+ static body = serverOnly
57
+ ? undefined
58
+ : "content_card";
59
+ async process(context) {
60
+ const t = desc.nodeType;
61
+ if (t === "lib.image.draw.Background") {
62
+ const width = clampDim(this.width, 512, 4096);
63
+ const height = clampDim(this.height, 512, 4096);
64
+ // Source module — no input texture, just the host-specified output dims.
65
+ const [r, g, b, a] = premultiplyVec4(colorValueToVec4(this.color ?? "#FFFFFF", [1, 1, 1, 1]));
66
+ return {
67
+ output: await runShaderNode(sourcesSolidV1, { color: d.vec4f(r, g, b, a) }, null, { outputWidth: width, outputHeight: height }, context)
68
+ };
69
+ }
70
+ if (t === "lib.image.draw.GaussianNoise") {
71
+ const w = clampDim(this.width, 512, 1024);
72
+ const h = clampDim(this.height, 512, 1024);
73
+ const mean = num(this.mean, 0);
74
+ const stddev = num(this.stddev, 1);
75
+ // seed < 0 (the -1 default) → fresh random seed each run, reproducing
76
+ // the old Math.random() variation. A pinned seed ≥ 0 makes the noise
77
+ // reproducible across runs.
78
+ const requestedSeed = Math.floor(num(this.seed, -1));
79
+ const seed = requestedSeed < 0
80
+ ? Math.floor(Math.random() * 100000)
81
+ : requestedSeed;
82
+ return {
83
+ output: await runShaderNode(sourcesGaussianNoiseV1, { mean, stddev, seed }, null, { outputWidth: w, outputHeight: h }, context)
84
+ };
85
+ }
86
+ const baseObj = pickImage(this.serialize(), this.serialize());
87
+ const baseBytes = await loadImageBytes(baseObj, context);
88
+ if (baseBytes.length === 0) {
89
+ return { output: baseObj ?? {} };
90
+ }
91
+ if (t === "lib.image.Mask") {
92
+ const sharp = await loadSharp();
93
+ if (!sharp)
94
+ throw new Error(SHARP_UNAVAILABLE_MESSAGE);
95
+ // SAFETY: the generated class carries these as dynamic properties, so
96
+ // the class type declares none of them.
97
+ const self = this;
98
+ const fg = await loadImageBytes(self.foreground ?? self.image2 ?? self.image1, context);
99
+ if (fg.length) {
100
+ const mask = await loadImageBytes(self.mask, context);
101
+ const baseMeta = await sharp(baseBytes, { failOn: "none" }).metadata();
102
+ const width = Math.max(1, baseMeta.width ?? 1);
103
+ const height = Math.max(1, baseMeta.height ?? 1);
104
+ let fgInput = await sharp(fg, { failOn: "none" })
105
+ .resize(width, height, { fit: "fill" })
106
+ .ensureAlpha()
107
+ .png()
108
+ .toBuffer();
109
+ if (mask.length) {
110
+ const { data: fgRaw, info } = await sharp(fgInput, {
111
+ failOn: "none"
112
+ })
113
+ .ensureAlpha()
114
+ .raw()
115
+ .toBuffer({ resolveWithObject: true });
116
+ const maskRaw = await sharp(mask, { failOn: "none" })
117
+ .resize(info.width, info.height, { fit: "fill" })
118
+ .greyscale()
119
+ .raw()
120
+ .toBuffer();
121
+ for (let i = 0; i < info.width * info.height; i += 1) {
122
+ fgRaw[i * 4 + 3] = maskRaw[i];
123
+ }
124
+ fgInput = await sharp(fgRaw, {
125
+ raw: { width: info.width, height: info.height, channels: 4 }
126
+ })
127
+ .png()
128
+ .toBuffer();
129
+ }
130
+ const mixed = await sharp(baseBytes, { failOn: "none" })
131
+ .resize(width, height, { fit: "fill" })
132
+ .composite([{ input: fgInput, blend: "over" }])
133
+ .png()
134
+ .toBuffer();
135
+ return { output: toBase64Ref(mixed, baseObj) };
136
+ }
137
+ }
138
+ if (t.includes(".draw.RenderText")) {
139
+ const text = String(this.text ?? "");
140
+ if (!text) {
141
+ return { output: toBase64Ref(baseBytes, baseObj) };
142
+ }
143
+ const x = num(this.x, 0);
144
+ const y = num(this.y, 0);
145
+ const size = Math.min(512, Math.max(1, num(this.size, 12)));
146
+ const colorVal = this.color ?? "#000000";
147
+ const color = isObjectLike(colorVal) && "value" in colorVal
148
+ ? String(colorVal.value)
149
+ : String(colorVal);
150
+ const fontVal = this.font;
151
+ const fontFamily = isObjectLike(fontVal) && "name" in fontVal
152
+ ? String(fontVal.name)
153
+ : "sans-serif";
154
+ const align = String(this.align ?? "left");
155
+ if (!IS_NODE) {
156
+ // Browser: rasterize the text onto the image with OffscreenCanvas.
157
+ const bitmap = await createImageBitmap(new Blob([toArrayBuffer(baseBytes)]));
158
+ const canvas = new OffscreenCanvas(bitmap.width, bitmap.height);
159
+ const ctx = canvas.getContext("2d");
160
+ if (!ctx)
161
+ throw new Error("OffscreenCanvas 2D context unavailable");
162
+ ctx.drawImage(bitmap, 0, 0);
163
+ bitmap.close();
164
+ ctx.font = `${size}px ${fontFamily}`;
165
+ ctx.fillStyle = color;
166
+ ctx.textAlign =
167
+ align === "center" ? "center" : align === "right" ? "right" : "left";
168
+ ctx.textBaseline = "alphabetic";
169
+ ctx.fillText(text, x, y + size);
170
+ const blob = await canvas.convertToBlob({ type: "image/png" });
171
+ return {
172
+ output: toBase64Ref(new Uint8Array(await blob.arrayBuffer()), baseObj)
173
+ };
174
+ }
175
+ // Node: composite an SVG <text> over the image with sharp.
176
+ const sharp = await loadSharp();
177
+ if (!sharp)
178
+ throw new Error(SHARP_UNAVAILABLE_MESSAGE);
179
+ const textAnchor = align === "center" ? "middle" : align === "right" ? "end" : "start";
180
+ const escapedText = escapeXmlAttr(text);
181
+ const md = await sharp(baseBytes, { failOn: "none" }).metadata();
182
+ const svgWidth = md.width ?? 512;
183
+ const svgHeight = md.height ?? 512;
184
+ // Every interpolated attribute is escaped — a quote in color/font would
185
+ // otherwise break out of the attribute and inject SVG markup into sharp.
186
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${svgWidth}" height="${svgHeight}"><text x="${x}" y="${y + size}" font-size="${size}" fill="${escapeXmlAttr(color)}" font-family="${escapeXmlAttr(fontFamily)}" text-anchor="${escapeXmlAttr(textAnchor)}">${escapedText}</text></svg>`;
187
+ const out = await sharp(baseBytes, { failOn: "none" })
188
+ .composite([{ input: Buffer.from(svg) }])
189
+ .png()
190
+ .toBuffer();
191
+ return { output: toBase64Ref(out, baseObj) };
192
+ }
193
+ // Fallthrough (e.g. Mask with no foreground): pass the source through.
194
+ return { output: toBase64Ref(baseBytes, baseObj) };
195
+ }
196
+ };
197
+ for (const property of desc.properties) {
198
+ registerDeclaredProperty(C, property.name, property.options);
199
+ }
200
+ return C;
201
+ }
202
+ const DESCRIPTORS = [
203
+ {
204
+ nodeType: "lib.image.draw.Background",
205
+ title: "Background",
206
+ description: "The Background Node creates a blank background.\n image, background, blank, base, layer\n This node is mainly used for generating a base layer for image processing tasks. It produces a uniform image, having a user-specified width, height and color. The color is given in a hexadecimal format, defaulting to white if not specified.\n\n #### Applications\n - As a base layer for creating composite images.\n - As a starting point for generating patterns or graphics.\n - When blank backgrounds of specific colors are required for visualization tasks.",
207
+ inlineFields: [],
208
+ inputFields: [],
209
+ outputs: {
210
+ output: "image"
211
+ },
212
+ properties: [
213
+ {
214
+ name: "width",
215
+ options: {
216
+ type: "int",
217
+ default: 512,
218
+ title: "Width",
219
+ min: 1,
220
+ max: 4096
221
+ }
222
+ },
223
+ {
224
+ name: "height",
225
+ options: {
226
+ type: "int",
227
+ default: 512,
228
+ title: "Height",
229
+ min: 1,
230
+ max: 4096
231
+ }
232
+ },
233
+ {
234
+ name: "color",
235
+ options: {
236
+ type: "color",
237
+ default: {
238
+ type: "color",
239
+ value: "#FFFFFF"
240
+ },
241
+ title: "Color"
242
+ }
243
+ }
244
+ ]
245
+ },
246
+ {
247
+ nodeType: "lib.image.draw.GaussianNoise",
248
+ title: "Gaussian Noise",
249
+ description: "This node creates and adds Gaussian noise to an image.\n image, noise, gaussian, distortion, artifact\n\n The Gaussian Noise Node is designed to simulate realistic distortions that can occur in a photographic image. It generates a noise-filled image using the Gaussian (normal) distribution. The noise level can be adjusted using the mean and standard deviation parameters.\n\n #### Applications\n - Simulating sensor noise in synthetic data.\n - Testing image-processing algorithms' resilience to noise.\n - Creating artistic effects in images.",
250
+ inlineFields: [],
251
+ inputFields: [],
252
+ outputs: {
253
+ output: "image"
254
+ },
255
+ properties: [
256
+ {
257
+ name: "mean",
258
+ options: {
259
+ type: "float",
260
+ default: 0,
261
+ title: "Mean"
262
+ }
263
+ },
264
+ {
265
+ name: "stddev",
266
+ options: {
267
+ type: "float",
268
+ default: 1,
269
+ title: "Stddev"
270
+ }
271
+ },
272
+ {
273
+ name: "width",
274
+ options: {
275
+ type: "int",
276
+ default: 512,
277
+ title: "Width",
278
+ min: 1,
279
+ max: 1024
280
+ }
281
+ },
282
+ {
283
+ name: "height",
284
+ options: {
285
+ type: "int",
286
+ default: 512,
287
+ title: "Height",
288
+ min: 1,
289
+ max: 1024
290
+ }
291
+ },
292
+ {
293
+ name: "seed",
294
+ options: {
295
+ type: "int",
296
+ default: -1,
297
+ title: "Seed",
298
+ description: "Random seed for reproducibility (-1 for a fresh random seed each run).",
299
+ min: -1
300
+ }
301
+ }
302
+ ]
303
+ },
304
+ {
305
+ nodeType: "lib.image.draw.RenderText",
306
+ title: "Render Text",
307
+ description: "Draw text onto an image using a system-available font family.\n text, font, label, title, watermark, caption, image, overlay\n\n This node takes text, a font family name, coordinates (where to place the\n text), and an image to work with. Use it to add a label or title to an\n image, watermark an image, or place a caption directly on an image.\n\n You can set the font family name, size, color, and alignment (left, center,\n or right), and position the text anywhere on the image.\n\n ### Fonts\n\n Only the font's `name` is used, as a font-family name resolved against the\n fonts available to the renderer (Canvas2D in the browser, sharp/librsvg on\n the server). If the named family isn't available, the renderer falls back to\n a default. The node does not download fonts, so the font's `source`, `url`,\n and `weight` fields are ignored.\n\n #### Applications\n - Labeling images in an image gallery or database.\n - Watermarking images for copyright protection.\n - Adding custom captions to photographs.\n - Creating instructional images to guide the reader's view.",
308
+ inlineFields: ["text"],
309
+ inputFields: ["image"],
310
+ outputs: {
311
+ output: "image"
312
+ },
313
+ properties: [
314
+ {
315
+ name: "text",
316
+ options: {
317
+ type: "str",
318
+ default: "",
319
+ title: "Text",
320
+ description: "The text to render."
321
+ }
322
+ },
323
+ {
324
+ name: "font",
325
+ options: {
326
+ type: "font",
327
+ default: {
328
+ type: "font",
329
+ name: "DejaVuSans",
330
+ source: "system",
331
+ url: "",
332
+ weight: "regular"
333
+ },
334
+ title: "Font",
335
+ description: "The font family to use, resolved by name against the fonts available to the renderer. Only the font name is used; source, url, and weight are ignored."
336
+ }
337
+ },
338
+ {
339
+ name: "x",
340
+ options: {
341
+ type: "int",
342
+ default: 0,
343
+ title: "X",
344
+ description: "The x coordinate."
345
+ }
346
+ },
347
+ {
348
+ name: "y",
349
+ options: {
350
+ type: "int",
351
+ default: 0,
352
+ title: "Y",
353
+ description: "The y coordinate."
354
+ }
355
+ },
356
+ {
357
+ name: "size",
358
+ options: {
359
+ type: "int",
360
+ default: 12,
361
+ title: "Size",
362
+ description: "The font size.",
363
+ min: 1,
364
+ max: 512
365
+ }
366
+ },
367
+ {
368
+ name: "color",
369
+ options: {
370
+ type: "color",
371
+ default: {
372
+ type: "color",
373
+ value: "#000000"
374
+ },
375
+ title: "Color",
376
+ description: "The font color."
377
+ }
378
+ },
379
+ {
380
+ name: "align",
381
+ options: {
382
+ type: "enum",
383
+ default: "left",
384
+ title: "Align",
385
+ values: ["left", "center", "right"]
386
+ }
387
+ },
388
+ {
389
+ name: "image",
390
+ options: {
391
+ type: "image",
392
+ default: {
393
+ type: "image",
394
+ uri: "",
395
+ asset_id: null,
396
+ data: null,
397
+ metadata: null
398
+ },
399
+ title: "Image",
400
+ description: "The image to render on."
401
+ }
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ nodeType: "lib.image.Mask",
407
+ title: "Mask",
408
+ description: "Combine two images using a mask for advanced compositing.\n composite, mask, blend, layering\n\n Use cases:\n - Create complex image compositions\n - Apply selective blending or effects\n - Implement advanced photo editing techniques",
409
+ inlineFields: [],
410
+ inputFields: ["image1", "image2", "mask"],
411
+ outputs: {
412
+ output: "image"
413
+ },
414
+ properties: [
415
+ {
416
+ name: "image1",
417
+ options: {
418
+ type: "image",
419
+ default: {
420
+ type: "image",
421
+ uri: "",
422
+ asset_id: null,
423
+ data: null,
424
+ metadata: null
425
+ },
426
+ title: "Image1",
427
+ description: "The first image to composite."
428
+ }
429
+ },
430
+ {
431
+ name: "image2",
432
+ options: {
433
+ type: "image",
434
+ default: {
435
+ type: "image",
436
+ uri: "",
437
+ asset_id: null,
438
+ data: null,
439
+ metadata: null
440
+ },
441
+ title: "Image2",
442
+ description: "The second image to composite."
443
+ }
444
+ },
445
+ {
446
+ name: "mask",
447
+ options: {
448
+ type: "image",
449
+ default: {
450
+ type: "image",
451
+ uri: "",
452
+ asset_id: null,
453
+ data: null,
454
+ metadata: null
455
+ },
456
+ title: "Mask",
457
+ description: "The mask to composite with."
458
+ }
459
+ }
460
+ ]
461
+ }
462
+ ];
463
+ export const LIB_IMAGE_DRAW_NODES = DESCRIPTORS.map(createDrawNode);
464
+ //# sourceMappingURL=lib-image-draw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-image-draw.js","sourceRoot":"","sources":["../../src/nodes/lib-image-draw.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAG3E,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,OAAO,EACL,gBAAgB,EAChB,GAAG,EACH,eAAe,EACf,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,EACT,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,8EAA8E;AAC9E,2EAA2E;AAC3E,+EAA+E;AAC/E,SAAS,QAAQ,CAAC,KAAc,EAAE,QAAgB,EAAE,GAAW;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,2EAA2E;AAC3E,2EAA2E;AAC3E,gFAAgF;AAChF,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,KAA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AAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE;wBACP,IAAI,EAAE,OAAO;wBACb,GAAG,EAAE,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,IAAI,EAAE,IAAI;wBACV,QAAQ,EAAE,IAAI;qBACf;oBACD,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,+BAA+B;iBAC7C;aACF;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE;wBACP,IAAI,EAAE,OAAO;wBACb,GAAG,EAAE,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,IAAI,EAAE,IAAI;wBACV,QAAQ,EAAE,IAAI;qBACf;oBACD,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,gCAAgC;iBAC9C;aACF;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE;wBACP,IAAI,EAAE,OAAO;wBACb,GAAG,EAAE,EAAE;wBACP,QAAQ,EAAE,IAAI;wBACd,IAAI,EAAE,IAAI;wBACV,QAAQ,EAAE,IAAI;qBACf;oBACD,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,6BAA6B;iBAC3C;aACF;SACF;KACF;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAyB,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * `lib.image.effects.*` — single-image layer effects (drop shadow, outline,
3
+ * colour overlay, glow) plus additive composite. Backed by the GPU shader
4
+ * pool (Dawn) — shaders are an implementation detail; nodes are organized by
5
+ * what the user is doing.
6
+ */
7
+ import { BaseNode } from "@nodetool-ai/node-sdk";
8
+ import type { ImageRef } from "@nodetool-ai/node-sdk";
9
+ import type { ProcessingContext } from "@nodetool-ai/runtime";
10
+ declare class ColorOverlayNode extends BaseNode {
11
+ static readonly nodeType = "lib.image.effects.ColorOverlay";
12
+ static readonly title = "Color Overlay";
13
+ static readonly description = "Tint an image with a constant colour while preserving source coverage.\n image, overlay, tint, layer effect";
14
+ static readonly inputFields: string[];
15
+ static readonly metadataOutputTypes: {
16
+ output: string;
17
+ };
18
+ process(context?: ProcessingContext): Promise<{
19
+ output: ImageRef;
20
+ }>;
21
+ }
22
+ declare class OutlineNode extends BaseNode {
23
+ static readonly nodeType = "lib.image.effects.Outline";
24
+ static readonly title = "Outline";
25
+ static readonly description = "Draw a flat outline / stroke around the source silhouette.\n image, outline, stroke, edge, layer effect";
26
+ static readonly inputFields: string[];
27
+ static readonly metadataOutputTypes: {
28
+ output: string;
29
+ };
30
+ process(context?: ProcessingContext): Promise<{
31
+ output: ImageRef;
32
+ }>;
33
+ }
34
+ declare class DropShadowNode extends BaseNode {
35
+ static readonly nodeType = "lib.image.effects.DropShadow";
36
+ static readonly title = "Drop Shadow";
37
+ static readonly description = "Cast a soft drop shadow behind the source silhouette.\n image, drop shadow, layer effect, blur";
38
+ static readonly inputFields: string[];
39
+ static readonly metadataOutputTypes: {
40
+ output: string;
41
+ };
42
+ process(context?: ProcessingContext): Promise<{
43
+ output: ImageRef;
44
+ }>;
45
+ }
46
+ declare class GlowNode extends BaseNode {
47
+ static readonly nodeType = "lib.image.effects.Glow";
48
+ static readonly title = "Glow";
49
+ static readonly description = "Bloom / glow effect: bright-pass + blur + additive composite over source.\n image, glow, bloom, layer effect, blur";
50
+ static readonly inputFields: string[];
51
+ static readonly metadataOutputTypes: {
52
+ output: string;
53
+ };
54
+ process(context?: ProcessingContext): Promise<{
55
+ output: ImageRef;
56
+ }>;
57
+ }
58
+ declare class AddBlendNode extends BaseNode {
59
+ static readonly nodeType = "lib.image.effects.Add";
60
+ static readonly title = "Add Blend";
61
+ static readonly description = "Additive composite of two images: out = source + over \u00D7 gain.\n image, add, blend, composite";
62
+ static readonly inputFields: string[];
63
+ static readonly metadataOutputTypes: {
64
+ output: string;
65
+ };
66
+ process(context?: ProcessingContext): Promise<{
67
+ output: ImageRef;
68
+ }>;
69
+ }
70
+ export declare const LIB_IMAGE_EFFECTS_NODES: (typeof ColorOverlayNode | typeof OutlineNode | typeof DropShadowNode | typeof GlowNode | typeof AddBlendNode)[];
71
+ export { ColorOverlayNode, OutlineNode, DropShadowNode, GlowNode, AddBlendNode };
72
+ //# sourceMappingURL=lib-image-effects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-image-effects.d.ts","sourceRoot":"","sources":["../../src/nodes/lib-image-effects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAA4B,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA0B9D,cAAM,gBAAiB,SAAQ,QAAQ;IACrC,MAAM,CAAC,QAAQ,CAAC,QAAQ,oCAAoC;IAC5D,MAAM,CAAC,QAAQ,CAAC,KAAK,mBAAmB;IACxC,MAAM,CAAC,QAAQ,CAAC,WAAW,oHACwF;IACnH,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAa;IACxC,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QAAK,MAAM;MAAY;IAEpD,OAAO,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,CAAC,CAaxE;CACF;AAKD,cAAM,WAAY,SAAQ,QAAQ;IAChC,MAAM,CAAC,QAAQ,CAAC,QAAQ,+BAA+B;IACvD,MAAM,CAAC,QAAQ,CAAC,KAAK,aAAa;IAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,gHACoF;IAC/G,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAa;IACxC,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QAAK,M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