Node-RED Image Processing Toolkit
A comprehensive Node-RED package providing 20 specialized nodes for high-performance image processing using C++ OpenCV backend. Perfect for computer vision workflows, batch processing, and automated image manipulation.

Documentation
| Section | Pages |
|---|---|
| Overview | Installation, requirements, nodes, image format and common settings |
| I/O nodes | image-in · folder-in · image-out |
| Transform nodes | resize · rotate · crop · padding · filter · draw · color-convert |
| Mix nodes | concat · mosaic · advanced-mosaic |
| Blend nodes | blend · add-mask · add-masks · add-bbs |
| Specialized nodes | cropBB · image-align · heat-diff |
The same pages are published at https://docs.rosepetal.ai/flows/node-red-contrib-image-tools.
🚀 Quick Start
Installation (users)
From Node-RED (Palette Manager)
- Open Palette Manager → Install → search
@rosepetal/node-red-contrib-image-tools.
From npm (CLI, default)
cd ~/.node-red
npm install @rosepetal/node-red-contrib-image-toolsDevelopment installation (build from source)
For contributors or platforms without a prebuilt binary:
./install.sh
# or manual steps:
cd rosepetal-image-engine && npm install && npm run build
cd .. && npm install
cd ~/.node-red && npm install /path/to/node-red-contrib-image-toolsnpm installs fetch prebuilt binaries for common platforms; build from source only if you are developing or a prebuilt is unavailable.
Requirements
- Node.js 18.17+ (required by the
sharpdependency) and Node-RED 1.0.0+ - Only to build from source: node-gyp build tools, OpenCV 4.x (auto-detected via pkg-config) and a C++ compiler with C++17 support
📋 Node Categories
I/O Nodes - Data Flow Management
| Node | Purpose | Key Features |
|---|---|---|
| image-in | Load images from filesystem | JPEG/PNG/WebP/etc. support, Sharp backend |
| folder-in | Emit the images of a folder one by one | Configurable interval, loop or one-shot mode, start/stop button |
| image-out | Save images with timestamp naming | Auto-naming, overwrite protection, format conversion |
Transform Nodes - Image Processing
| Node | Purpose | Key Features |
|---|---|---|
| resize | Scale images with aspect ratio control | Proportional scaling, multiple modes |
| rotate | Rotate images with custom padding | Sub-pixel precision, background colors |
| crop | Extract regions with pixel/normalized coords | Dynamic coordinates, bounds checking |
| padding | Add configurable margins | Color customization, flexible sizing |
| filter | Apply enhancement filters | Blur, sharpen, edge, emboss, Gaussian |
| draw | Overlay points and lines on images | Normalized coordinates, typed inputs, C++ compositing |
| color-convert | Convert images between color spaces | GRAY, RGB, RGBA, BGR and BGRA |
Mix Nodes - Image Composition
| Node | Purpose | Key Features |
|---|---|---|
| concat | Combine images horizontally/vertically | Direction control, padding strategies |
| mosaic | Position images on canvas | Coordinate positioning, manual placement |
| advanced-mosaic | Complex layouts with custom positioning | Pixel-perfect control, layering |
Blend Nodes - Advanced Compositing
| Node | Purpose | Key Features |
|---|---|---|
| blend | Alpha blend two images with opacity | Background removal, color tolerance |
| add-mask | Apply polygon-based masks to regions | Coordinate arrays, mask strength control |
| add-masks | Apply multiple polygon masks colored by class | Class color mappings, global mask strength |
| add-bbs | Draw bounding boxes with labels on images | Tag and confidence labels, color per tag |
Specialized Nodes - AI/ML Integration
| Node | Purpose | Key Features |
|---|---|---|
| cropBB | Extract crops from AI bounding boxes | Object detection integration, confidence filtering |
| image-align | Align an image to a reference with ECC, ORB/SIFT features, or both | Translation to homography models, speed presets |
| heat-diff | Heat map of the difference between two images | Colormaps, blur and threshold, difference statistics |
Architecture & Performance
Two-Tier Design
- JavaScript Layer: Node-RED integration, validation, I/O handling
- C++ Layer: OpenCV-powered image processing for maximum performance
Performance Benefits
- Faster! than pure JavaScript implementations
- Parallel processing for array operations
- Memory efficient with optimized algorithms
- Async operations with real-time performance timing
- Never blocks the event loop: decoding, processing and encoding (including BMP and colour-space swaps) all run on the libuv thread pool; the JavaScript layer only validates and routes messages
Image Data Format
{
data: Buffer, // Raw pixel data
width: number, // Image width in pixels
height: number, // Image height in pixels
channels: number, // Channel count (1, 3, 4)
colorSpace: string, // "GRAY", "RGB", "RGBA", "BGR", "BGRA"
dtype: string // "uint8" (standard)
}🛠️ Development
Project Structure
docs/nodes/ # Individual node documentation
assets/ # Documentation assets
node-red-contrib-image-tools/ # Node-RED package sources
├── nodes/ # Node-RED node implementations
│ ├── io/ # I/O nodes
│ ├── transform/ # Transform nodes
│ ├── mix/ # Composition nodes
│ ├── blend/ # Blending nodes
│ └── specialized/ # AI/ML nodes
└── lib/ # Shared utilities
rosepetal-image-engine/ # C++ processing engine
├── src/ # OpenCV implementations
├── binding.gyp # Node.js addon configuration
└── package.jsonAdding New Nodes
- Implement C++ processing in
rosepetal-image-engine/src/ - Export function in
src/main.cpp - Create Node-RED wrapper in appropriate
nodes/category - Add comprehensive documentation following existing patterns
🚨 Troubleshooting
Common Issues
- Build Failures: Ensure OpenCV 4.x installed and pkg-config available
- Missing Nodes: Check Node-RED installation path and package registration
- Performance Issues: Verify C++ addon built with optimization flags
- Memory Problems: Process large images in smaller batches
Performance Tips
- Use raw format for processing chains (fastest)
- Process arrays when possible for parallel execution
- Choose appropriate output formats for your destination
- Monitor node status displays for timing information
- Under heavy concurrency, raise the libuv thread pool (default 4 threads, shared with
sharpand file I/O) before starting Node-RED, e.g.UV_THREADPOOL_SIZE=8 node-red
🤝 Contributing
- Issues: Report bugs and feature requests via GitHub
- Pull Requests: Contributions welcome for new nodes and optimizations
- Documentation: Help improve guides and examples
📄 License
Apache-2.0 (see the LICENSE file). This project is part of the Rosepetal development toolkit for Node-RED image processing applications.
💡 Pro Tip: Start with simple single-node workflows, then combine them into complex processing pipelines as you become familiar with the image format and node interactions.