@rosepetal/node-red-contrib-image-tools 1.2.2 → 1.3.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/.github/workflows/build-prebuild.yml +3 -0
- package/install.sh +8 -0
- package/node-red-contrib-image-tools/lib/node-utils.js +64 -0
- package/node-red-contrib-image-tools/nodes/blend/add-bbs.html +242 -3
- package/node-red-contrib-image-tools/nodes/blend/add-bbs.js +10 -3
- package/node-red-contrib-image-tools/nodes/blend/add-mask.html +282 -4
- package/node-red-contrib-image-tools/nodes/blend/add-mask.js +15 -8
- package/node-red-contrib-image-tools/nodes/blend/add-masks.html +206 -3
- package/node-red-contrib-image-tools/nodes/blend/add-masks.js +10 -3
- package/node-red-contrib-image-tools/nodes/blend/blend.html +332 -4
- package/node-red-contrib-image-tools/nodes/blend/blend.js +10 -3
- package/node-red-contrib-image-tools/nodes/io/folder-in.html +147 -3
- package/node-red-contrib-image-tools/nodes/io/folder-in.js +2 -1
- package/node-red-contrib-image-tools/nodes/io/image-in.html +81 -2
- package/node-red-contrib-image-tools/nodes/io/image-in.js +2 -1
- package/node-red-contrib-image-tools/nodes/io/image-out.html +197 -3
- package/node-red-contrib-image-tools/nodes/io/image-out.js +2 -1
- package/node-red-contrib-image-tools/nodes/mix/advanced-mosaic.html +398 -3
- package/node-red-contrib-image-tools/nodes/mix/advanced-mosaic.js +11 -4
- package/node-red-contrib-image-tools/nodes/mix/concat.html +245 -5
- package/node-red-contrib-image-tools/nodes/mix/concat.js +10 -3
- package/node-red-contrib-image-tools/nodes/mix/mosaic.html +307 -3
- package/node-red-contrib-image-tools/nodes/mix/mosaic.js +10 -3
- package/node-red-contrib-image-tools/nodes/specialized/cropBB.html +217 -4
- package/node-red-contrib-image-tools/nodes/specialized/cropBB.js +11 -2
- package/node-red-contrib-image-tools/nodes/specialized/image-align.html +285 -4
- package/node-red-contrib-image-tools/nodes/specialized/image-align.js +9 -2
- package/node-red-contrib-image-tools/nodes/transform/color-convert.html +169 -6
- package/node-red-contrib-image-tools/nodes/transform/color-convert.js +11 -2
- package/node-red-contrib-image-tools/nodes/transform/crop.html +237 -5
- package/node-red-contrib-image-tools/nodes/transform/crop.js +11 -2
- package/node-red-contrib-image-tools/nodes/transform/draw.html +152 -3
- package/node-red-contrib-image-tools/nodes/transform/draw.js +10 -3
- package/node-red-contrib-image-tools/nodes/transform/filter.html +369 -4
- package/node-red-contrib-image-tools/nodes/transform/filter.js +11 -2
- package/node-red-contrib-image-tools/nodes/transform/padding.html +316 -5
- package/node-red-contrib-image-tools/nodes/transform/padding.js +11 -2
- package/node-red-contrib-image-tools/nodes/transform/resize.html +203 -5
- package/node-red-contrib-image-tools/nodes/transform/resize.js +11 -2
- package/node-red-contrib-image-tools/nodes/transform/rotate.html +164 -5
- package/node-red-contrib-image-tools/nodes/transform/rotate.js +11 -2
- package/package.json +71 -71
- package/scripts/dual-register.js +267 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- nodes/rosepetal-concat/concat.html -->
|
|
2
2
|
|
|
3
3
|
<script type="text/javascript">
|
|
4
|
-
|
|
4
|
+
var _rpNodeCfg = {
|
|
5
5
|
category:'RP Image',
|
|
6
6
|
color:'#DDA0DD',
|
|
7
7
|
icon:'font-awesome/fa-th-large',
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
outputFormat:{value:"raw"},
|
|
13
13
|
outputQuality:{value:90},
|
|
14
14
|
pngOptimize:{value:false},
|
|
15
|
+
webpLossless:{value:false},
|
|
16
|
+
webpSmartSubsample:{value:false},
|
|
17
|
+
webpEffort:{value:""},
|
|
15
18
|
// Debug configuration
|
|
16
19
|
debugEnabled:{value:false},
|
|
17
20
|
debugWidth:{value:200},
|
|
@@ -21,7 +24,7 @@
|
|
|
21
24
|
padColor :{value:"#000000"}
|
|
22
25
|
},
|
|
23
26
|
inputs:1,outputs:1,
|
|
24
|
-
label:function(){return this.name||"concat";},
|
|
27
|
+
label:function(){return this.name||"rp-concat";},
|
|
25
28
|
oneditprepare:function(){
|
|
26
29
|
/* path typedInputs */
|
|
27
30
|
$("#node-input-inputPath").typedInput({
|
|
@@ -42,6 +45,11 @@
|
|
|
42
45
|
const format = $("#node-input-outputFormat").val();
|
|
43
46
|
$("#quality-row").toggle(format === "jpg" || format === "webp");
|
|
44
47
|
$("#png-optimize-row").toggle(format === "png");
|
|
48
|
+
// Show WebP advanced options only when WebP is selected
|
|
49
|
+
const isWebp = format === 'webp';
|
|
50
|
+
$("#webp-lossless-row").toggle(isWebp);
|
|
51
|
+
$("#webp-smartsubsample-row").toggle(isWebp);
|
|
52
|
+
$("#webp-effort-row").toggle(isWebp);
|
|
45
53
|
}
|
|
46
54
|
$("#node-input-outputFormat").on("change", updateQualityVisibility);
|
|
47
55
|
updateQualityVisibility(); // initial state
|
|
@@ -77,7 +85,9 @@
|
|
|
77
85
|
$('#node-input-debugEnabled').data('debug-enabled', enabled);
|
|
78
86
|
});
|
|
79
87
|
}
|
|
80
|
-
}
|
|
88
|
+
};
|
|
89
|
+
RED.nodes.registerType('rp-concat', _rpNodeCfg);
|
|
90
|
+
RED.nodes.registerType('concat', Object.assign({}, _rpNodeCfg, { category: 'deprecated' }));
|
|
81
91
|
|
|
82
92
|
// Debug image display renderer - shared across all image processing nodes
|
|
83
93
|
if (!window.debugImageRendererInitialized) {
|
|
@@ -189,7 +199,7 @@
|
|
|
189
199
|
}
|
|
190
200
|
</script>
|
|
191
201
|
|
|
192
|
-
<script type="text/x-red" data-template-name="concat">
|
|
202
|
+
<script type="text/x-red" data-template-name="rp-concat">
|
|
193
203
|
<div class="form-row">
|
|
194
204
|
<label><i class="fa fa-sign-in"></i> Input</label>
|
|
195
205
|
<input type="text" id="node-input-inputPath" style="width:70%;">
|
|
@@ -219,7 +229,107 @@
|
|
|
219
229
|
<input type="checkbox" id="node-input-pngOptimize" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
220
230
|
<label for="node-input-pngOptimize" style="width:auto; margin-left:5px;">Compress PNG (slower, smaller file)</label>
|
|
221
231
|
</div>
|
|
232
|
+
<div class="form-row" id="webp-lossless-row" style="display: none;">
|
|
233
|
+
<label for="node-input-webpLossless"><i class="fa fa-lock"></i> Lossless</label>
|
|
234
|
+
<input type="checkbox" id="node-input-webpLossless" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
235
|
+
<label for="node-input-webpLossless" style="width:auto; margin-left:5px;">Encode WebP without loss</label>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="form-row" id="webp-smartsubsample-row" style="display: none;">
|
|
238
|
+
<label for="node-input-webpSmartSubsample"><i class="fa fa-magic"></i> Smart Subsample</label>
|
|
239
|
+
<input type="checkbox" id="node-input-webpSmartSubsample" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
240
|
+
<label for="node-input-webpSmartSubsample" style="width:auto; margin-left:5px;">Better chroma downsampling (lossy only)</label>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="form-row" id="webp-effort-row" style="display: none;">
|
|
243
|
+
<label for="node-input-webpEffort"><i class="fa fa-tachometer"></i> Effort</label>
|
|
244
|
+
<input type="number" id="node-input-webpEffort" min="0" max="6" placeholder="4" style="width: 70px;">
|
|
245
|
+
<span style="margin-left: 10px; color: #666;">0-6 (higher = smaller file, slower)</span>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<!-- Debug Configuration -->
|
|
249
|
+
<div class="form-row">
|
|
250
|
+
<label for="node-input-debugEnabled"><i class="fa fa-bug"></i> Debug</label>
|
|
251
|
+
<input type="checkbox" id="node-input-debugEnabled" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
252
|
+
<label for="node-input-debugEnabled" style="width:auto; margin-left:5px;">Show processed image</label>
|
|
253
|
+
</div>
|
|
254
|
+
<div class="form-row" id="debug-width-row" style="display: none;">
|
|
255
|
+
<label for="node-input-debugWidth"><i class="fa fa-arrows-h"></i> Debug Width</label>
|
|
256
|
+
<input type="text" id="node-input-debugWidth" style="width: 120px;">
|
|
257
|
+
<input type="hidden" id="node-input-debugWidthType">
|
|
258
|
+
<span style="margin-left: 10px; color: #666;">pixels</span>
|
|
259
|
+
</div>
|
|
222
260
|
|
|
261
|
+
<hr/>
|
|
262
|
+
<div class="form-row">
|
|
263
|
+
<label><i class="fa fa-arrows-h"></i> Direction</label>
|
|
264
|
+
<select id="node-input-direction">
|
|
265
|
+
<option value="right">→ Right</option>
|
|
266
|
+
<option value="left">← Left</option>
|
|
267
|
+
<option value="down">↓ Down</option>
|
|
268
|
+
<option value="up">↑ Up</option>
|
|
269
|
+
</select>
|
|
270
|
+
</div>
|
|
271
|
+
<div class="form-row">
|
|
272
|
+
<label><i class="fa fa-th"></i> Strategy</label>
|
|
273
|
+
<select id="node-input-strategy">
|
|
274
|
+
<option value="pad-start">Pad at start</option>
|
|
275
|
+
<option value="pad-end">Pad at end</option>
|
|
276
|
+
<option value="pad-both">Pad both sides</option>
|
|
277
|
+
<option value="resize">Resize to max</option>
|
|
278
|
+
</select>
|
|
279
|
+
</div>
|
|
280
|
+
<!-- único cambio: id para poder toggle‑ar -->
|
|
281
|
+
<div class="form-row" id="pad-colour-row">
|
|
282
|
+
<label for="node-input-padColor"><i class="fa fa-tint"></i> Pad colour</label>
|
|
283
|
+
<input type="color" id="node-input-padColor" style="width:80px;">
|
|
284
|
+
</div>
|
|
285
|
+
</script>
|
|
286
|
+
|
|
287
|
+
<script type="text/x-red" data-template-name="concat">
|
|
288
|
+
<div class="form-row">
|
|
289
|
+
<label><i class="fa fa-sign-in"></i> Input</label>
|
|
290
|
+
<input type="text" id="node-input-inputPath" style="width:70%;">
|
|
291
|
+
<input type="hidden" id="node-input-inputPathType">
|
|
292
|
+
</div>
|
|
293
|
+
<div class="form-row">
|
|
294
|
+
<label><i class="fa fa-sign-out"></i> Output</label>
|
|
295
|
+
<input type="text" id="node-input-outputPath" style="width:70%;">
|
|
296
|
+
<input type="hidden" id="node-input-outputPathType">
|
|
297
|
+
</div>
|
|
298
|
+
<div class="form-row">
|
|
299
|
+
<label for="node-input-outputFormat"><i class="fa fa-file-image-o"></i> Output Format</label>
|
|
300
|
+
<select id="node-input-outputFormat" style="width: 200px;">
|
|
301
|
+
<option value="raw">Raw (fastest)</option>
|
|
302
|
+
<option value="jpg">JPEG</option>
|
|
303
|
+
<option value="png">PNG</option>
|
|
304
|
+
<option value="webp">WebP</option>
|
|
305
|
+
</select>
|
|
306
|
+
</div>
|
|
307
|
+
<div class="form-row" id="quality-row">
|
|
308
|
+
<label for="node-input-outputQuality"><i class="fa fa-sliders"></i> Quality</label>
|
|
309
|
+
<input type="number" id="node-input-outputQuality" min="1" max="100" value="90" style="width: 70px;">
|
|
310
|
+
<span style="margin-left: 10px; color: #666;">1-100 (JPG/WebP only)</span>
|
|
311
|
+
</div>
|
|
312
|
+
<div class="form-row" id="png-optimize-row" style="display: none;">
|
|
313
|
+
<label for="node-input-pngOptimize"><i class="fa fa-compress"></i> PNG Optimize</label>
|
|
314
|
+
<input type="checkbox" id="node-input-pngOptimize" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
315
|
+
<label for="node-input-pngOptimize" style="width:auto; margin-left:5px;">Compress PNG (slower, smaller file)</label>
|
|
316
|
+
</div>
|
|
317
|
+
<div class="form-row" id="webp-lossless-row" style="display: none;">
|
|
318
|
+
<label for="node-input-webpLossless"><i class="fa fa-lock"></i> Lossless</label>
|
|
319
|
+
<input type="checkbox" id="node-input-webpLossless" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
320
|
+
<label for="node-input-webpLossless" style="width:auto; margin-left:5px;">Encode WebP without loss</label>
|
|
321
|
+
</div>
|
|
322
|
+
<div class="form-row" id="webp-smartsubsample-row" style="display: none;">
|
|
323
|
+
<label for="node-input-webpSmartSubsample"><i class="fa fa-magic"></i> Smart Subsample</label>
|
|
324
|
+
<input type="checkbox" id="node-input-webpSmartSubsample" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
325
|
+
<label for="node-input-webpSmartSubsample" style="width:auto; margin-left:5px;">Better chroma downsampling (lossy only)</label>
|
|
326
|
+
</div>
|
|
327
|
+
<div class="form-row" id="webp-effort-row" style="display: none;">
|
|
328
|
+
<label for="node-input-webpEffort"><i class="fa fa-tachometer"></i> Effort</label>
|
|
329
|
+
<input type="number" id="node-input-webpEffort" min="0" max="6" placeholder="4" style="width: 70px;">
|
|
330
|
+
<span style="margin-left: 10px; color: #666;">0-6 (higher = smaller file, slower)</span>
|
|
331
|
+
</div>
|
|
332
|
+
|
|
223
333
|
<!-- Debug Configuration -->
|
|
224
334
|
<div class="form-row">
|
|
225
335
|
<label for="node-input-debugEnabled"><i class="fa fa-bug"></i> Debug</label>
|
|
@@ -259,7 +369,137 @@
|
|
|
259
369
|
</div>
|
|
260
370
|
</script>
|
|
261
371
|
|
|
262
|
-
<script type="text/x-red" data-help-name="concat">
|
|
372
|
+
<script type="text/x-red" data-help-name="rp-concat">
|
|
373
|
+
<p><b>rosepetal-concat</b> combines multiple images into a single composite image through concatenation. Images can be joined horizontally or vertically with intelligent handling of size differences using padding or scaling strategies.</p>
|
|
374
|
+
|
|
375
|
+
<h3>Details</h3>
|
|
376
|
+
<p>This node processes arrays of images and combines them into a seamless composite using high-performance C++ operations. It supports flexible concatenation directions, intelligent sizing strategies, and maintains image quality throughout the process. The node handles both raw pixel data and encoded image files transparently.</p>
|
|
377
|
+
|
|
378
|
+
<h3>Properties</h3>
|
|
379
|
+
<dl class="message-properties">
|
|
380
|
+
<dt>Input from <span class="property-type">string</span></dt>
|
|
381
|
+
<dd>Message property path containing the input image array. Supports <code>msg</code>, <code>flow</code>, or <code>global</code> context via TypedInput.</dd>
|
|
382
|
+
|
|
383
|
+
<dt>Output to <span class="property-type">string</span></dt>
|
|
384
|
+
<dd>Message property path where the concatenated image will be stored. Supports <code>msg</code>, <code>flow</code>, or <code>global</code> context via TypedInput.</dd>
|
|
385
|
+
|
|
386
|
+
<dt>Output Format <span class="property-type">string</span></dt>
|
|
387
|
+
<dd>Format for the output image: <code>raw</code> (fastest), <code>jpg</code>, <code>png</code>, or <code>webp</code>.</dd>
|
|
388
|
+
|
|
389
|
+
<dt>Quality <span class="property-type">number</span></dt>
|
|
390
|
+
<dd>Compression quality (1-100) for JPEG and WebP formats. Only visible when JPG or WebP is selected.</dd>
|
|
391
|
+
|
|
392
|
+
<dt>Direction <span class="property-type">string</span></dt>
|
|
393
|
+
<dd>Concatenation direction: <code>right</code> (→), <code>left</code> (←), <code>down</code> (↓), or <code>up</code> (↑).</dd>
|
|
394
|
+
|
|
395
|
+
<dt>Strategy <span class="property-type">string</span></dt>
|
|
396
|
+
<dd>Size handling strategy: <code>pad-start</code>, <code>pad-end</code>, <code>pad-both</code>, or <code>resize</code>.</dd>
|
|
397
|
+
|
|
398
|
+
<dt>Pad Colour <span class="property-type">color</span></dt>
|
|
399
|
+
<dd>Background color for padding areas when using pad strategies. Hidden when resize strategy is selected.</dd>
|
|
400
|
+
</dl>
|
|
401
|
+
|
|
402
|
+
<h3>Inputs</h3>
|
|
403
|
+
<p>The input should be an array of image objects in the standard format:</p>
|
|
404
|
+
<pre>{
|
|
405
|
+
data: Buffer, // Raw pixel data or encoded file buffer
|
|
406
|
+
width: number, // Image width in pixels
|
|
407
|
+
height: number, // Image height in pixels
|
|
408
|
+
channels: number, // Channel count (1=grayscale, 3=RGB, 4=RGBA)
|
|
409
|
+
colorSpace: string, // "GRAY", "RGB", "RGBA", "BGR", "BGRA"
|
|
410
|
+
dtype: string // "uint8", "uint16", "float32"
|
|
411
|
+
}</pre>
|
|
412
|
+
<p>File buffers (JPEG, PNG, WebP, BMP) are automatically detected and decoded.</p>
|
|
413
|
+
|
|
414
|
+
<h3>Outputs</h3>
|
|
415
|
+
<p>Produces a single concatenated image in the specified format:</p>
|
|
416
|
+
<ul>
|
|
417
|
+
<li><b>Raw format:</b> Complete image object with pixel data and metadata</li>
|
|
418
|
+
<li><b>Encoded formats (JPG/PNG/WebP):</b> File buffer ready for storage or transmission</li>
|
|
419
|
+
</ul>
|
|
420
|
+
<p>Output dimensions depend on input images and concatenation direction. Width/height are calculated automatically based on the combined images.</p>
|
|
421
|
+
|
|
422
|
+
<h3>Concatenation Strategies</h3>
|
|
423
|
+
<h4>Padding Strategies</h4>
|
|
424
|
+
<ul>
|
|
425
|
+
<li><b>Pad Start:</b> Adds padding before smaller images (top for horizontal, left for vertical)</li>
|
|
426
|
+
<li><b>Pad End:</b> Adds padding after smaller images (bottom for horizontal, right for vertical)</li>
|
|
427
|
+
<li><b>Pad Both:</b> Centers smaller images with equal padding on both sides</li>
|
|
428
|
+
</ul>
|
|
429
|
+
<h4>Resize Strategy</h4>
|
|
430
|
+
<ul>
|
|
431
|
+
<li><b>Resize:</b> Scales all images to match the largest dimension, eliminating gaps entirely</li>
|
|
432
|
+
</ul>
|
|
433
|
+
|
|
434
|
+
<h3>Direction Behavior</h3>
|
|
435
|
+
<ul>
|
|
436
|
+
<li><b>Right (→):</b> Images placed left-to-right, heights normalized</li>
|
|
437
|
+
<li><b>Left (←):</b> Images placed right-to-left, heights normalized</li>
|
|
438
|
+
<li><b>Down (↓):</b> Images stacked top-to-bottom, widths normalized</li>
|
|
439
|
+
<li><b>Up (↑):</b> Images stacked bottom-to-top, widths normalized</li>
|
|
440
|
+
</ul>
|
|
441
|
+
|
|
442
|
+
<h3>Examples</h3>
|
|
443
|
+
<h4>Horizontal Photo Strip</h4>
|
|
444
|
+
<p>Create a horizontal photo strip from portrait images:</p>
|
|
445
|
+
<ul>
|
|
446
|
+
<li>Direction: Right (→)</li>
|
|
447
|
+
<li>Strategy: Pad Both</li>
|
|
448
|
+
<li>Pad Color: White (#FFFFFF)</li>
|
|
449
|
+
</ul>
|
|
450
|
+
|
|
451
|
+
<h4>Vertical Timeline</h4>
|
|
452
|
+
<p>Stack images vertically for a timeline view:</p>
|
|
453
|
+
<ul>
|
|
454
|
+
<li>Direction: Down (↓)</li>
|
|
455
|
+
<li>Strategy: Resize</li>
|
|
456
|
+
<li>Output: PNG for high quality</li>
|
|
457
|
+
</ul>
|
|
458
|
+
|
|
459
|
+
<h4>Dynamic Context Usage</h4>
|
|
460
|
+
<p>Use flow context for batch processing multiple image sets:</p>
|
|
461
|
+
<ul>
|
|
462
|
+
<li>Input from: flow.imageArray</li>
|
|
463
|
+
<li>Output to: flow.concatenated</li>
|
|
464
|
+
</ul>
|
|
465
|
+
|
|
466
|
+
<h3>Node Interactions</h3>
|
|
467
|
+
<ul>
|
|
468
|
+
<li><b>Upstream:</b> Works with <code>array-in</code>, <code>image-in</code>, or any nodes producing image arrays</li>
|
|
469
|
+
<li><b>Downstream:</b> Connect to <code>array-out</code>, file writers, or further processing nodes</li>
|
|
470
|
+
<li><b>Chaining:</b> Can be chained with other mix nodes for complex compositions</li>
|
|
471
|
+
<li><b>Flow Integration:</b> Supports flow and global context for cross-node data sharing</li>
|
|
472
|
+
</ul>
|
|
473
|
+
|
|
474
|
+
<h3>Output Formats</h3>
|
|
475
|
+
<ul>
|
|
476
|
+
<li><b>Raw (fastest):</b> Uncompressed pixel data, ideal for further processing</li>
|
|
477
|
+
<li><b>JPEG:</b> Lossy compression, smaller files, quality parameter controls compression level</li>
|
|
478
|
+
<li><b>PNG:</b> Lossless compression, preserves transparency, larger files</li>
|
|
479
|
+
<li><b>WebP:</b> Modern format with superior compression, quality parameter available</li>
|
|
480
|
+
</ul>
|
|
481
|
+
|
|
482
|
+
<h3>Error Handling</h3>
|
|
483
|
+
<ul>
|
|
484
|
+
<li><b>Input Validation:</b> Comprehensive validation of image structure and array format</li>
|
|
485
|
+
<li><b>Size Compatibility:</b> Automatic handling of different image dimensions</li>
|
|
486
|
+
<li><b>Memory Management:</b> Efficient memory usage with automatic cleanup</li>
|
|
487
|
+
<li><b>Format Support:</b> Graceful handling of mixed input formats</li>
|
|
488
|
+
<li><b>Warning System:</b> Uses <code>node.warn()</code> for non-fatal issues without stopping flow</li>
|
|
489
|
+
</ul>
|
|
490
|
+
|
|
491
|
+
<h3>Performance</h3>
|
|
492
|
+
<ul>
|
|
493
|
+
<li><b>C++ Backend:</b> High-performance OpenCV-based processing with optimized build flags</li>
|
|
494
|
+
<li><b>Zero-Copy Operations:</b> Minimal memory allocation and copying for maximum efficiency</li>
|
|
495
|
+
<li><b>Parallel Processing:</b> Array operations processed in parallel using Promise.all()</li>
|
|
496
|
+
<li><b>Status Timing:</b> Real-time performance metrics displayed as <code>conv | task | enc</code> (conversion, processing, encoding)</li>
|
|
497
|
+
<li><b>Memory Optimization:</b> Automatic memory management and garbage collection</li>
|
|
498
|
+
<li><b>Build Optimization:</b> Compiled with <code>-O3</code>, <code>-march=native</code>, <code>-ffast-math</code> flags</li>
|
|
499
|
+
</ul>
|
|
500
|
+
</script>
|
|
501
|
+
|
|
502
|
+
<script type="text/x-red" data-help-name="concat">
|
|
263
503
|
<p><b>rosepetal-concat</b> combines multiple images into a single composite image through concatenation. Images can be joined horizontally or vertically with intelligent handling of size differences using padding or scaling strategies.</p>
|
|
264
504
|
|
|
265
505
|
<h3>Details</h3>
|
|
@@ -76,11 +76,17 @@ module.exports = function (RED) {
|
|
|
76
76
|
const outputFormat = config.outputFormat || 'raw';
|
|
77
77
|
const outputQuality = parseInt(config.outputQuality) || 90;
|
|
78
78
|
const pngOptimize = config.pngOptimize || false;
|
|
79
|
+
const useSharpWebp = outputFormat === 'webp' && NodeUtils.hasAdvancedWebpOptions(config);
|
|
80
|
+
const cppFormat = useSharpWebp ? 'raw' : outputFormat;
|
|
79
81
|
const padColorHex = config.padColor || '#000000';
|
|
80
82
|
|
|
81
83
|
/* ▸ Single call to the C++ addon --------------------------------- */
|
|
82
|
-
|
|
83
|
-
await Cpp.concat(imgs, direction, strategy, padColorHex,
|
|
84
|
+
let { image, timing = {} } =
|
|
85
|
+
await Cpp.concat(imgs, direction, strategy, padColorHex, cppFormat, outputQuality, pngOptimize);
|
|
86
|
+
|
|
87
|
+
if (useSharpWebp) {
|
|
88
|
+
image = await NodeUtils.encodeWebpAdvanced(image, config);
|
|
89
|
+
}
|
|
84
90
|
|
|
85
91
|
/* ▸ Write the single result back to msg -------------------------- */
|
|
86
92
|
NodeUtils.setOutputValue(node, msg, outputPath, outputPathType, image);
|
|
@@ -145,5 +151,6 @@ module.exports = function (RED) {
|
|
|
145
151
|
});
|
|
146
152
|
}
|
|
147
153
|
|
|
148
|
-
RED.nodes.registerType('concat', ConcatNode);
|
|
154
|
+
RED.nodes.registerType('rp-concat', ConcatNode);
|
|
155
|
+
RED.nodes.registerType('concat', ConcatNode); // legacy compat
|
|
149
156
|
};
|