nob_reframe (Compatible with IFFS 2025.1.0 and up)
This Matchbox shader reframes a shot with respect to perspective distortion.
The concept of this shader is to simulate a different focal length and camera orientation while maintaining the camera’s position.
Image-wise only spatial transformations are applied to acquire this alternate view, thus brightness is retained and bokeh is transformed with the image (note that this can lead to deformed bokeh when extremely wide source FoV and strong off-centreing come together).
The input
The resulting image format can be customized to any canvas resolution as well as frame and pixel aspect ratios. In cases of different frame aspect ratios, the content is automatically scaled to fit the resulting frame height. Downscaling images to smaller formats while applying reframing, rectification and rotation at the same time is a particular strength of this shader, since it applies all operations simultaneously. In contrast to a multi-node pipeline, this circumvents generational loss due to multiple introductions of softness and/or aliasing in the individual steps.
By default, antialiasing is disabled for performance reasons, though it is strongly encouraged to enable it for final output. Filtering is done through either a Box- or a Gauss-Kernel, the former - in combination with a width of 1, corresponding to the default
In lens-distortion rectification (un-distortion) and re-distortion workflows, the order of operations matters. Logically, the image is first rectified, then perspectively transformed, and lastly re-distorted (albeit internally, for creating the ST map, those operations are reversed & performed inverted, respectively). The transformation is only correct for undistorted images, hence the rectification module in this shader. Do not attempt to correct existing distortion in
For enhanced performance, this shader internally uses an ST map representing the aggregate transformation which itself is bilinearly filtered; the nature of which is well behaved for typical use, resulting in negligible interpolation errors. Supersampling then takes place on the application of this ST map.
Note that this may cause a loss of information for border pixels, which would interpolate from sample locations outside the target-frame.
To eliminate this error, one can specify a higher & wider canvas resolution, accommodating the filtering kernel size; to then crop the output to the desired format using the <Resize & Crop> node.
Take care to maintain correct pixel- & frame aspect ratios between reframing & crop. Use the
Upressing is best done with other means than this shader. Significant enlargements of image portions to a canvas of equal resolution to the input might also result in strong pixelation.
For this, one can output the intermediate ST map and feed it into an external filter better suited towards upressing. Note that when outputting STs, the Matte output is intentionally left black to incentivize running it too through external filtering.
Adaptive Degradation is supported by this shader, which if active bypasses antialiasing.
This shader is licensed under the terms of the MIT license.
For questions contact:
nobbl211 _at_ gmail.com
Version notes
fixed bug that prevented the lens distortion module from working
Older versions that shader
13th of September this year, around 13:29
Downloadfixed bug that prevented the lens distortion module from working
9th of September this year, around 14:40
DownloadReworked Lens Distortion Module to allow for Re-Distortion in addition to Rectification
Introduced support for external maps of Lens Un- and Re-Distortion STs, compatible with Flame’s Lens Distortion node
Redistributed Gauss-Kernel for filtering, leading to better results with fewer samples
Fixed matte transformations and generation (if left unconnected)
Changed Front wrap mode to GL_CLAMP_TO_EDGE, to repeat border pixels in transformations involving out-of-bounds regions, matching unpremultiplied workflows
minor changes and fixes
Breaking change: improved the Rectification algorithm, Lens Distortion Parameters from previous versions of this shader are incompatible
4th of September this year, around 14:56
DownloadIntroduced Gauss filtering for antialiasing
as well as minor changes & fixes.
Something wrong with this page or the download?
Contact the site custodians via email, if:
- This shader is obviously incomplete (missing files, not loading) etc.
- This shader violates IP rules (is pirated) or contains harmful content
- You are having problems with the shader installer (INSTALL.command) or the download.
How to get help with this particular shader
Sadly, the custodians likely will not be able to explain to you how a shader works or debug its code, or fix it for you. That is the (volountary) role of the shader author.
If the shader does not work on your system or you have questions about it - read the shader description, and try to find the email address of the shader author. Contact them for any issues – letting them know whether you are on Mac or Linux, what version of IFFS you are running etc. will likely help. Be kind and respectful. If you can't get hold of the author - you can try asking in the Logik forum at logik.tv and ask whether anyone could help you debug a particular shader not working.