td_analyze_frame
Analyze pixel data of a TouchDesigner TOP node without transferring the full image. Run server-side numpy analysis for histograms, luminance, alpha coverage, dominant color, or region differences.
Instructions
Analyze pixel data of a TOP node without transferring full image data.
Runs server-side numpy analysis inside TouchDesigner and returns statistical results per requested mode. Supported modes:
histogram: per-channel (RGB) pixel value histograms
luminance: mean, min, max, std, p5, p95 of perceived luminance
alpha_coverage: alpha channel statistics (requires RGBA TOP)
color_dominant: most frequent quantized color in the frame
roi_diff: pixel-level diff between a region and a reference TOP
For roi_diff, also pass roi=[x, y, w, h] and reference_path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roi | No | Region of interest [x, y, w, h] for roi_diff mode | |
| path | Yes | Path to a TOP node to analyze | |
| modes | No | Analysis modes: histogram, luminance, alpha_coverage, color_dominant, roi_diff. Defaults to ['histogram', 'luminance'] when omitted. | |
| thresholds | No | Optional visual-quality threshold overrides. | |
| sample_grid | No | Grid size used by TD-side sample() fallback and normalized quality metrics. | |
| quality_mode | No | If True, include normalized visual-quality metrics in the TD response. | |
| reference_path | No | Reference TOP path for roi_diff mode |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |