STMap Extension v2

A BlinkScript-driven utility designed to extrapolate and pad cropped ST maps beyond their original bounding boxes.

First submitted: 29 April 2026

Updated: 1 May 2026

Author: Marty Blumen

Website: https://www.martyblumen.com/

Compatible Nuke versions: 14.0 or later

Compatibility: Source

ST Map Overscan v2

Description: A BlinkScript-driven utility designed to extrapolate and pad cropped ST maps beyond their original bounding boxes.

Standard UV pipelines often break down when lens distortion maps or baked UV passes are heavily cropped or fail to cover a required overscan area. This tool places the source ST map into a new, larger format and mathematically synthesizes the missing UV coordinates outside the original boundaries.

Core Features:

  • Format & Positioning: Defines a new output format. The source map can be automatically centered within the new canvas or manually offset via X/Y pixel controls.

  • Extrapolation Modes:

    • Linear (Default): Per-axis slope/curvature of the outermost trusted pixels is projected outward. Maintains the trajectory of lens distortion or surface UVs into the padded region.

    • Clamp: Repeats the outermost pixel values (standard edge extend behavior).

    • Zero: Fills the extended area with [0, 0] values.

    • Fade: Generates a linear falloff from the edge values down to zero based on the padding distance.

  • Extrapolation Order (new in v2): Selects between linear (first-order Taylor) and quadratic (second-order Taylor) extension. Order 1 fits a straight line through edge samples; order 2 fits a parabola through three samples along the normal using Lagrange interpolation, capturing the curvature of fisheye, anamorphic, and wide-angle distortion. Order 2 cleanly degenerates to linear when curvature is zero, so it can be left enabled for any input.

  • Edge Smoothing: A critical control for linear mode. It averages pixel samples tangent to the bounding box edge before calculating the outward slope. This prevents microscopic input noise or aliasing at the crop line from being multiplied into infinite streaks across the extrapolated area. Also defines the baseline distance for slope and curvature estimation.

  • Edge Trim (new in v2): Shrinks the trusted region by a configurable number of pixels on each side; the trimmed pixels are replaced by synthetic extrapolated values. Useful when the input has unreliable outermost pixels — black bleeds from incomplete renders, ringing from upstream interpolation, or anti-aliasing softness at the crop boundary. Available in three modes:

    • Uniform: Single trim value applied to all four edges.

    • Per-Edge Override: Independent left/right/top/bottom controls.

    • Auto-Analyze: Samples the input, fits a linear trend to interior values, detects where outermost pixels deviate from that trend, and sets per-edge trim automatically.

Technical Notes:

  • Bbox Aware: The internal BlinkScript kernel reads directly from src.bounds. Any upstream Crop nodes will be strictly respected as the extrapolation boundary.

  • Lens Distortion: For real-world lens maps, start with Order 2 and Edge Smoothing in the 8–16 pixel range. Excessive smoothing will average out the mathematical curvature required at the edges of the lens; quadratic order recovers some of that curvature when smoothing is moderate.

  • Trim with Order 2: Quadratic mode benefits significantly from edge trim when the source has soft or noisy outer pixels — curvature estimation amplifies edge artifacts harder than linear, so trimming a few pixels off and re-synthesizing them often produces a cleaner result than fighting the noise with smoothing alone.

  • Performance: Fully GPU-accelerated via an ePixelWise BlinkScript kernel. No compiled NDK plugins required. Auto-Analyze runs once on demand via Python sampling and writes its results back to the trim knobs; not in the per-cook path.

Installation: Simply copy and paste the provided code directly into your Nuke Node Graph, or save it as a .gizmo or ToolSet within your pipeline environment.

OpenSource:
https://github.com/bratgot/STMapExtension

MIT License

Copyright (c) [2026] [Marten Blumen]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

or register to download or rate.

Comments

or register to join the conversation.

Download Verification