PixelSort

Read with AI
All docs in one file (llms-full.txt)
pixelsort #ProFx #Node
PixelSort

It treats a run of consecutive pixels whose brightness (0.298912R + 0.586611G + 0.114478B) falls within the Threshold MinMax range as one interval, and reorders only within that interval by brightness. The reordering is a bitonic sort on a compute shader, running in one Dispatch per row (or column).

  • Enable — OFF passes through unchanged. Default ON (Enable input / isUsingInput / currentIsUsing)
  • Direction — ON is horizontal (along rows), OFF is vertical (along columns). Default ON. The toggle in the node UI is named “Horizontal” (Direction input / directionInput / currentDirection)
  • Ascending — the sort order. Default ON (Ascending input / ascendingInput / currentAscending)
  • Threshold Min — default 0.4. The UI slider is 0–1 (ThresholdMin input / thresholdMinInput / currentThresholdMin)
  • Threshold Max — default 0.6. The UI slider is 0–1 (ThresholdMax input / thresholdMaxInput / currentThresholdMax)
  • Mask — the white areas (where R is 1) become the sorted result and the black areas the original image (lerp(original, sorted, mask.r)). When it is not connected, the sorted result comes out as-is

If the size of the axis being sorted is 2048 or more, it is not processed and passes through unchanged (an error appears in the console). A horizontal sort looks at the width and a vertical sort at the height, so sorting 4K width (3840) horizontally has no effect.

The output is allocated at the global resolution and does not follow the input’s resolution. When the resolutions differ, it is scaled at the end.

The first publish to the output port happens 15 frames after startup.

When the input (Layer) is not connected, the output is filled with black.

Input ports

Port IDType
LayerRenderTexture
MaskRenderTexture
Enablebool
Directionbool
Ascendingbool
ThresholdMinfloat
ThresholdMaxfloat

Output ports

Port IDType
OutRenderTexture

Scriptable members

PathType
isUsingInputbool
directionInputbool
ascendingInputbool
thresholdMinInputfloat
thresholdMaxInputfloat
currentIsUsingbool
currentDirectionbool
currentAscendingbool
currentThresholdMinfloat
currentThresholdMaxfloat

Synapse Apps (scripting)

await synapse.modules.create({ type: "pixelsort" })

Also referenced from