@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,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
|
|
2
|
+
var _rpNodeCfg = {
|
|
3
3
|
category: 'RP Image',
|
|
4
4
|
color: '#A6C8A6',
|
|
5
5
|
defaults: {
|
|
@@ -65,7 +65,39 @@
|
|
|
65
65
|
// Initialize visibility
|
|
66
66
|
updateDebugWidthVisibility();
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
|
+
RED.nodes.registerType('rp-image-in', _rpNodeCfg);
|
|
70
|
+
RED.nodes.registerType('image-in', Object.assign({}, _rpNodeCfg, { category: 'deprecated' }));
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<script type="text/x-red" data-template-name="rp-image-in">
|
|
74
|
+
<div class="form-row">
|
|
75
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
76
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
77
|
+
</div>
|
|
78
|
+
<div class="form-row">
|
|
79
|
+
<label for="node-input-filePath"><i class="fa fa-folder-open"></i> File Path</label>
|
|
80
|
+
<input type="text" id="node-input-filePath" style="width: 70%;" placeholder="/path/to/your/image.jpg">
|
|
81
|
+
<input type="hidden" id="node-input-filePathType">
|
|
82
|
+
</div>
|
|
83
|
+
<hr>
|
|
84
|
+
<div class="form-row">
|
|
85
|
+
<label for="node-input-outputPath"><i class="fa fa-sign-out"></i> Output to</label>
|
|
86
|
+
<input type="text" id="node-input-outputPath" style="width: 70%;">
|
|
87
|
+
<input type="hidden" id="node-input-outputPathType">
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<!-- Debug Configuration -->
|
|
91
|
+
<div class="form-row">
|
|
92
|
+
<label for="node-input-debugEnabled"><i class="fa fa-bug"></i> Debug</label>
|
|
93
|
+
<input type="checkbox" id="node-input-debugEnabled" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
94
|
+
<label for="node-input-debugEnabled" style="width:auto; margin-left:5px;">Show loaded image</label>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="form-row" id="debug-width-row" style="display: none;">
|
|
97
|
+
<label for="node-input-debugWidth"><i class="fa fa-arrows-h"></i> Debug Width</label>
|
|
98
|
+
<input type="text" id="node-input-debugWidth" style="width: 120px;">
|
|
99
|
+
<input type="hidden" id="node-input-debugWidthType">
|
|
100
|
+
</div>
|
|
69
101
|
</script>
|
|
70
102
|
|
|
71
103
|
<script type="text/x-red" data-template-name="image-in">
|
|
@@ -98,6 +130,53 @@
|
|
|
98
130
|
</div>
|
|
99
131
|
</script>
|
|
100
132
|
|
|
133
|
+
<script type="text/x-red" data-help-name="rp-image-in">
|
|
134
|
+
<p>Loads an image file from the filesystem and outputs it as a raw image object for processing in the Node-RED flow.</p>
|
|
135
|
+
|
|
136
|
+
<h3>Details</h3>
|
|
137
|
+
<p>This node reads image files from disk and converts them into the standard image format used throughout the Rosepetal Image Tools. It supports various image formats including JPEG, PNG, WebP, and BMP. The image is decoded using a high-performance C++ backend with OpenCV.</p>
|
|
138
|
+
|
|
139
|
+
<h3>Properties</h3>
|
|
140
|
+
<dl class="message-properties">
|
|
141
|
+
<dt>File Path <span class="property-type">string | msg | flow | global</span></dt>
|
|
142
|
+
<dd>The path to the image file on the server filesystem. Can be a static string (absolute or relative path) or dynamically resolved from message properties, flow context, or global context. Supports common image formats: JPEG, PNG, WebP, BMP.</dd>
|
|
143
|
+
<dt>Output to <span class="property-type">string</span></dt>
|
|
144
|
+
<dd>The location where the resulting image object will be stored. You can select between <code>msg</code>, <code>flow</code>, or <code>global</code> context. Defaults to <code>msg.payload</code>.</dd>
|
|
145
|
+
</dl>
|
|
146
|
+
|
|
147
|
+
<h3>Inputs</h3>
|
|
148
|
+
<dl class="message-properties">
|
|
149
|
+
<dt>payload <span class="property-type">any</span></dt>
|
|
150
|
+
<dd>Input message (content is ignored, only triggers the node operation).</dd>
|
|
151
|
+
</dl>
|
|
152
|
+
|
|
153
|
+
<h3>Outputs</h3>
|
|
154
|
+
<p>The node sets the property specified in 'Output to' with the processed image object using the standard format:</p>
|
|
155
|
+
<pre>{
|
|
156
|
+
data: Buffer, // Raw pixel data
|
|
157
|
+
width: number, // Image width in pixels
|
|
158
|
+
height: number, // Image height in pixels
|
|
159
|
+
channels: number, // Channel count (1, 3, 4)
|
|
160
|
+
colorSpace: string, // "GRAY", "RGB", "RGBA", "BGR", "BGRA"
|
|
161
|
+
dtype: string // "uint8", "uint16", "float32"
|
|
162
|
+
}</pre>
|
|
163
|
+
|
|
164
|
+
<h3>Examples</h3>
|
|
165
|
+
<ul>
|
|
166
|
+
<li><strong>Static Path:</strong> Set File Path to <code>/path/to/image.jpg</code> (string type) and Output to <code>msg.payload</code></li>
|
|
167
|
+
<li><strong>Dynamic Path from Message:</strong> Set File Path from <code>msg.imagePath</code> to load different images based on message content</li>
|
|
168
|
+
<li><strong>Flow Context Path:</strong> Set File Path from <code>flow.currentImageFile</code> to use a path stored in flow context</li>
|
|
169
|
+
<li><strong>Multiple Images:</strong> Connect to an array-out node to work with image collections</li>
|
|
170
|
+
<li><strong>Processing Pipeline:</strong> Connect to transform nodes like resize, rotate, or crop for image manipulation</li>
|
|
171
|
+
</ul>
|
|
172
|
+
|
|
173
|
+
<h3>Error Handling</h3>
|
|
174
|
+
<p>If the file path is invalid or the image cannot be read, the node will display a warning and not propagate the message. Check the debug panel for specific error details.</p>
|
|
175
|
+
|
|
176
|
+
<h3>Performance</h3>
|
|
177
|
+
<p>Image loading is performed asynchronously using the C++ backend for optimal performance. The node status displays processing time information.</p>
|
|
178
|
+
</script>
|
|
179
|
+
|
|
101
180
|
<script type="text/x-red" data-help-name="image-in">
|
|
102
181
|
<p>Loads an image file from the filesystem and outputs it as a raw image object for processing in the Node-RED flow.</p>
|
|
103
182
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
|
|
2
|
+
var _rpNodeCfg = {
|
|
3
3
|
category: 'RP Image',
|
|
4
4
|
color: '#A6C8A6',
|
|
5
5
|
defaults: {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
visible: function() { return true; },
|
|
40
40
|
onclick: function() {
|
|
41
41
|
var node = this;
|
|
42
|
-
var label = RED.utils.sanitize(this.name || "image-out");
|
|
42
|
+
var label = RED.utils.sanitize(this.name || "rp-image-out");
|
|
43
43
|
var desiredState = node.active;
|
|
44
44
|
|
|
45
45
|
sendToggleRequest(node, desiredState, function() {
|
|
@@ -184,7 +184,9 @@
|
|
|
184
184
|
// Initialize debug image display
|
|
185
185
|
initDebugImageDisplay();
|
|
186
186
|
}
|
|
187
|
-
}
|
|
187
|
+
};
|
|
188
|
+
RED.nodes.registerType('rp-image-out', _rpNodeCfg);
|
|
189
|
+
RED.nodes.registerType('image-out', Object.assign({}, _rpNodeCfg, { category: 'deprecated' }));
|
|
188
190
|
|
|
189
191
|
function sendToggleRequest(node, active, onSuccess, onError) {
|
|
190
192
|
$.ajax({
|
|
@@ -313,6 +315,120 @@
|
|
|
313
315
|
}
|
|
314
316
|
</script>
|
|
315
317
|
|
|
318
|
+
<script type="text/x-red" data-template-name="rp-image-out">
|
|
319
|
+
<div class="form-row">
|
|
320
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
321
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<hr>
|
|
325
|
+
|
|
326
|
+
<!-- Folder Configuration -->
|
|
327
|
+
<div class="form-row">
|
|
328
|
+
<label for="node-input-folderPath"><i class="fa fa-folder"></i> Folder Path</label>
|
|
329
|
+
<input type="text" id="node-input-folderPath" style="width: 70%;" placeholder="/path/to/save/folder">
|
|
330
|
+
<input type="hidden" id="node-input-folderPathType">
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
<div class="form-row">
|
|
334
|
+
<label for="node-input-filenamePrefix"><i class="fa fa-tag"></i> Filename Prefix</label>
|
|
335
|
+
<input type="text" id="node-input-filenamePrefix" style="width: 70%;" placeholder="image (optional)">
|
|
336
|
+
<input type="hidden" id="node-input-filenamePrefixType">
|
|
337
|
+
<div style="margin-left: 106px; margin-top: 4px; color: #666; font-size: 12px;">
|
|
338
|
+
Pattern: [prefix]_YYYYMMDD_HHMMSS.[ext]
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
|
|
342
|
+
<div class="form-row">
|
|
343
|
+
<label for="node-input-filenameFull"><i class="fa fa-file-text-o"></i> Full Filename</label>
|
|
344
|
+
<input type="text" id="node-input-filenameFull" style="width: 70%;" placeholder="photo_${payload.id}.jpg (optional)">
|
|
345
|
+
<input type="hidden" id="node-input-filenameFullType">
|
|
346
|
+
<div style="margin-left: 106px; margin-top: 4px; color: #666; font-size: 12px;">
|
|
347
|
+
Overrides prefix & timestamp when provided. Leave blank for automatic naming.
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<hr>
|
|
352
|
+
|
|
353
|
+
<!-- Input Configuration -->
|
|
354
|
+
<div class="form-row">
|
|
355
|
+
<label for="node-input-inputPath"><i class="fa fa-sign-in"></i> Input from</label>
|
|
356
|
+
<input type="text" id="node-input-inputPath" style="width: 70%;">
|
|
357
|
+
<input type="hidden" id="node-input-inputPathType">
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<hr>
|
|
361
|
+
|
|
362
|
+
<!-- Output Format Configuration -->
|
|
363
|
+
<div class="form-row">
|
|
364
|
+
<label for="node-input-outputFormat"><i class="fa fa-file-image-o"></i> Output Format</label>
|
|
365
|
+
<select id="node-input-outputFormat" style="width: 200px;">
|
|
366
|
+
<option value="jpg">JPEG</option>
|
|
367
|
+
<option value="png">PNG</option>
|
|
368
|
+
<option value="webp">WebP</option>
|
|
369
|
+
</select>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div class="form-row" id="quality-row">
|
|
373
|
+
<label for="node-input-outputQuality"><i class="fa fa-sliders"></i> Quality</label>
|
|
374
|
+
<input type="number" id="node-input-outputQuality" min="1" max="100" value="90" style="width: 70px;">
|
|
375
|
+
<span style="margin-left: 10px; color: #666;">1-100 (JPEG/WebP only)</span>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<div class="form-row" id="png-optimize-row" style="display: none;">
|
|
379
|
+
<label for="node-input-pngOptimize"><i class="fa fa-compress"></i> PNG Optimize</label>
|
|
380
|
+
<input type="checkbox" id="node-input-pngOptimize" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
381
|
+
<label for="node-input-pngOptimize" style="width:auto; margin-left:5px;">Compress PNG (slower, smaller file)</label>
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
<div class="form-row" id="webp-lossless-row" style="display: none;">
|
|
385
|
+
<label for="node-input-webpLossless"><i class="fa fa-lock"></i> WebP Lossless</label>
|
|
386
|
+
<input type="checkbox" id="node-input-webpLossless" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
387
|
+
<label for="node-input-webpLossless" style="width:auto; margin-left:5px;">Encode WebP without loss</label>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<div class="form-row" id="webp-smartsubsample-row" style="display: none;">
|
|
391
|
+
<label for="node-input-webpSmartSubsample"><i class="fa fa-magic"></i> WebP Smart Subsample</label>
|
|
392
|
+
<input type="checkbox" id="node-input-webpSmartSubsample" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
393
|
+
<label for="node-input-webpSmartSubsample" style="width:auto; margin-left:5px;">Improve chroma downsampling (lossy WebP only)</label>
|
|
394
|
+
</div>
|
|
395
|
+
|
|
396
|
+
<div class="form-row" id="webp-effort-row" style="display: none;">
|
|
397
|
+
<label for="node-input-webpEffort"><i class="fa fa-tachometer"></i> WebP Effort</label>
|
|
398
|
+
<input type="number" id="node-input-webpEffort" min="0" max="6" placeholder="4" style="width: 70px;">
|
|
399
|
+
<span style="margin-left: 10px; color: #666;">0-6 (higher = smaller file, slower)</span>
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
<hr>
|
|
403
|
+
|
|
404
|
+
<!-- Protection Settings -->
|
|
405
|
+
<div class="form-row">
|
|
406
|
+
<label for="node-input-overwriteProtection"><i class="fa fa-shield"></i> Protection</label>
|
|
407
|
+
<input type="checkbox" id="node-input-overwriteProtection" style="display:inline-block; width:auto; vertical-align:baseline;" checked>
|
|
408
|
+
<label for="node-input-overwriteProtection" style="width:auto; margin-left:5px;">Prevent overwriting existing files (_2, _3, etc.)</label>
|
|
409
|
+
</div>
|
|
410
|
+
|
|
411
|
+
<div class="form-row">
|
|
412
|
+
<label for="node-input-maxImages"><i class="fa fa-list-ol"></i> Max Images</label>
|
|
413
|
+
<input type="text" id="node-input-maxImages" style="width: 120px;" placeholder="0">
|
|
414
|
+
<input type="hidden" id="node-input-maxImagesType">
|
|
415
|
+
<span style="margin-left: 10px; color: #666;">0 or blank keeps all files.</span>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<!-- Debug Configuration -->
|
|
419
|
+
<div class="form-row">
|
|
420
|
+
<label for="node-input-debugEnabled"><i class="fa fa-bug"></i> Debug</label>
|
|
421
|
+
<input type="checkbox" id="node-input-debugEnabled" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
422
|
+
<label for="node-input-debugEnabled" style="width:auto; margin-left:5px;">Show saved image preview</label>
|
|
423
|
+
</div>
|
|
424
|
+
|
|
425
|
+
<div class="form-row" id="debug-width-row" style="display: none;">
|
|
426
|
+
<label for="node-input-debugWidth"><i class="fa fa-arrows-h"></i> Debug Width</label>
|
|
427
|
+
<input type="text" id="node-input-debugWidth" style="width: 120px;">
|
|
428
|
+
<input type="hidden" id="node-input-debugWidthType">
|
|
429
|
+
</div>
|
|
430
|
+
</script>
|
|
431
|
+
|
|
316
432
|
<script type="text/x-red" data-template-name="image-out">
|
|
317
433
|
<div class="form-row">
|
|
318
434
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
@@ -427,6 +543,84 @@
|
|
|
427
543
|
</div>
|
|
428
544
|
</script>
|
|
429
545
|
|
|
546
|
+
<script type="text/x-red" data-help-name="rp-image-out">
|
|
547
|
+
<p>Saves images to the filesystem with automatic timestamp-based naming and optional overwrite protection.</p>
|
|
548
|
+
|
|
549
|
+
<h3>Details</h3>
|
|
550
|
+
<p>This node saves image data to disk with automatic timestamp naming to ensure unique filenames. It includes an enable/disable button (similar to the debug node) that allows you to control whether images are saved without modifying your flow.</p>
|
|
551
|
+
|
|
552
|
+
<h3>Properties</h3>
|
|
553
|
+
<dl class="message-properties">
|
|
554
|
+
<dt>Folder Path <span class="property-type">string | msg | flow | global</span></dt>
|
|
555
|
+
<dd>The directory where images will be saved. Can be an absolute or relative path. The folder will be created if it doesn't exist. Can be dynamically set from message properties, flow context, or global context.</dd>
|
|
556
|
+
|
|
557
|
+
<dt>Filename Prefix <span class="property-type">string | msg | flow | global | JSONata</span></dt>
|
|
558
|
+
<dd>Optional prefix for the auto-generated filename. If not specified, defaults to <code>image</code>. The final filename pattern is: <code>[prefix]_YYYYMMDD_HHMMSS.[ext]</code>.</dd>
|
|
559
|
+
|
|
560
|
+
<dt>Full Filename <span class="property-type">string | msg | flow | global | JSONata</span></dt>
|
|
561
|
+
<dd>Overrides the prefix/timestamp pattern with an explicit name. Leave blank to keep automatic naming. You can include JSONata expressions or dynamic properties. If the expression supplies an extension (jpg/png/webp), the output format adjusts accordingly.</dd>
|
|
562
|
+
|
|
563
|
+
<dt>Input from <span class="property-type">string</span></dt>
|
|
564
|
+
<dd>The location of the image data to save. Defaults to <code>msg.payload</code>. Can be set to any message property, flow variable, or global variable.</dd>
|
|
565
|
+
|
|
566
|
+
<dt>Output Format <span class="property-type">select</span></dt>
|
|
567
|
+
<dd>The image format to save: JPEG, PNG, or WebP.</dd>
|
|
568
|
+
|
|
569
|
+
<dt>Quality <span class="property-type">number</span></dt>
|
|
570
|
+
<dd>Quality setting for JPEG and WebP formats (1-100). Higher values mean better quality but larger file sizes.</dd>
|
|
571
|
+
|
|
572
|
+
<dt>WebP Lossless <span class="property-type">boolean</span></dt>
|
|
573
|
+
<dd>When enabled and WebP is selected, encodes using lossless WebP (ignores the lossy quality slider).</dd>
|
|
574
|
+
|
|
575
|
+
<dt>WebP Effort <span class="property-type">number</span></dt>
|
|
576
|
+
<dd>Optional 0-6 encoder effort when WebP is selected. Higher values are slower but can yield slightly smaller files. Leave blank to use the default.</dd>
|
|
577
|
+
|
|
578
|
+
<dt>WebP Smart Subsample <span class="property-type">boolean</span></dt>
|
|
579
|
+
<dd>For lossy WebP only: enables smarter chroma downsampling to reduce color artifacts (slower).</dd>
|
|
580
|
+
|
|
581
|
+
<dt>PNG Optimize <span class="property-type">boolean</span></dt>
|
|
582
|
+
<dd>When enabled, applies maximum compression to PNG files. This creates smaller files but takes more processing time.</dd>
|
|
583
|
+
|
|
584
|
+
<dt>Overwrite Protection <span class="property-type">boolean</span></dt>
|
|
585
|
+
<dd>When enabled (default), automatically appends <code>_2</code>, <code>_3</code>, etc. to filenames if a file with the same name already exists.</dd>
|
|
586
|
+
|
|
587
|
+
<dt>Max Images <span class="property-type">number | msg | flow | global | JSONata</span></dt>
|
|
588
|
+
<dd>Optional FIFO retention policy for the target folder. When greater than zero, the node deletes the oldest files after saving to keep at most the specified number of images.</dd>
|
|
589
|
+
|
|
590
|
+
<dt>Active Button <span class="property-type">button</span></dt>
|
|
591
|
+
<dd>Click the button on the node to enable/disable saving. When disabled, the node passes messages through without saving images. The state is indicated by the button color (green = active, gray = inactive).</dd>
|
|
592
|
+
</dl>
|
|
593
|
+
|
|
594
|
+
<h3>Inputs</h3>
|
|
595
|
+
<dl class="message-properties">
|
|
596
|
+
<dt>Image Object <span class="property-type">object</span></dt>
|
|
597
|
+
<dd>Standard image structure with properties: data (Buffer), width, height, channels, colorSpace, dtype.</dd>
|
|
598
|
+
</dl>
|
|
599
|
+
|
|
600
|
+
<h3>Outputs</h3>
|
|
601
|
+
<p>This node has no outputs. It is a terminal node that saves images to the filesystem.</p>
|
|
602
|
+
|
|
603
|
+
<h3>Examples</h3>
|
|
604
|
+
<ul>
|
|
605
|
+
<li><strong>Basic Save:</strong> Connect to any image processing node output to save the result with timestamp naming.</li>
|
|
606
|
+
<li><strong>Dynamic Folder:</strong> Set folder path from <code>msg.folder</code> to save to different locations based on message content.</li>
|
|
607
|
+
<li><strong>With Prefix:</strong> Use prefix "webcam" to generate files like: <code>webcam_20240109_143022.jpg</code></li>
|
|
608
|
+
<li><strong>Overwrite Protection:</strong> If <code>image_20240109_143022.jpg</code> exists, saves as <code>image_20240109_143022_2.jpg</code></li>
|
|
609
|
+
<li><strong>Conditional Saving:</strong> Use the button to enable/disable saving during development or testing.</li>
|
|
610
|
+
</ul>
|
|
611
|
+
|
|
612
|
+
<h3>Status Indicators</h3>
|
|
613
|
+
<ul>
|
|
614
|
+
<li><strong>Gray dot "inactive":</strong> Node is disabled via button</li>
|
|
615
|
+
<li><strong>Blue dot "saving...":</strong> Currently writing file to disk</li>
|
|
616
|
+
<li><strong>Green dot "saved: filename":</strong> Successfully saved with filename shown</li>
|
|
617
|
+
<li><strong>Red dot "Error":</strong> Save failed (check debug panel for details)</li>
|
|
618
|
+
</ul>
|
|
619
|
+
|
|
620
|
+
<h3>Performance</h3>
|
|
621
|
+
<p>Image encoding and file writing are performed asynchronously for optimal performance. The node status displays the save time in milliseconds.</p>
|
|
622
|
+
</script>
|
|
623
|
+
|
|
430
624
|
<script type="text/x-red" data-help-name="image-out">
|
|
431
625
|
<p>Saves images to the filesystem with automatic timestamp-based naming and optional overwrite protection.</p>
|
|
432
626
|
|