FUSION · NODE REFERENCE
RankFilter
Local order-statistic pixel filter
RankFilter sorts pixels inside a local neighborhood by value and replaces the current pixel with the color of the selected ranked pixel. Rank 0 selects the lowest value, 0.5 is the median case and 1 selects the brightest; Size controls the sampled neighborhood.
RankFilter
Overview
What RankFilter does
RankFilter is fundamentally an order-statistic filter rather than an averaging filter. For each output location it examines nearby pixels, sorts them by value and chooses one actual sample from that ordered neighborhood.
Blackmagic explicitly contrasts this behavior with Blur. Blur aggregates neighboring samples, while RankFilter chooses one ranked sample. There is no Amount or Strength control; the visual result is governed by Size and Rank.
Rank is normalized from 0 to 1. The documentation defines 0 as the lowest value and 1 as the brightest value. Around 0.5 the tool behaves like a median filter, selecting the middle value rather than an extreme.
The median case is especially useful for impulse or salt-and-pepper noise. An isolated bright or dark outlier can disappear because it is no longer the middle-ranked sample, yet nearby edges are not averaged in the same way as a conventional blur.
Rank 0 gives min-like behavior. On a bright shape over a dark background, edge neighborhoods often contain darker samples, so small bright islands and thin bright details can contract or disappear while dark regions visually expand.
Rank 1 gives max-like behavior. Bright structures tend to expand and small dark holes can close because the brightest local sample is favored.
Intermediate ranks between 0 and 0.5 bias the result toward the lower end of the local distribution; ranks between 0.5 and 1 bias it toward the upper end. This makes the node useful beyond only the three obvious min/median/max cases.
Size defines the sampled area in pixels. The Blackmagic reference describes Size 1 as the immediate-neighbor case; larger values examine a wider neighborhood. Size is therefore not a normalized percentage of the frame.
Small Size values are the right starting point for cleanup. Blackmagic specifically notes small values as effective for salt-and-pepper style noise. If the defect is only one or two pixels wide, a large neighborhood needlessly increases the risk to real texture.
Large Size values change image structure rather than only isolated noise. The historical tool reference notes a watercolor-like effect at larger values as fine texture collapses into broader local regions.
RankFilter has a second optional blue Effect Mask input. It limits where the already-computed filter result is applied to the Image, which is useful for isolated dust, hot pixels or localized stylization.
Effect Mask is not a second image source for ranking. The ranked pixels come from Image; the mask controls coverage of the operation after processing.
For restoration, first prove the correct Size and Rank without a mask, then connect a Rectangle, Ellipse or Polygon to Effect Mask and reduce the treatment to the actual defect. This separates filter diagnosis from mask diagnosis.
Skin, hair, fine typography and film grain are easy to damage. Even a median-like rank can become visibly blocky at large Size, so inspect at 100% rather than only in Fit view.
On video, judge temporal stability. The local neighborhood changes from frame to frame; oversized neighborhoods or extreme ranks can cause crawling, popping or small geometry changes even if a single hero frame looks clean.
RankFilter is an image processor, not a mask generator. For matte workflows, make sure the material being filtered is represented as a suitable image or alpha-bearing raster instead of assuming every blue mask stream is interchangeable with the Image input.
When the task is explicit alpha growth/shrink with dedicated morphology controls, ErodeDilate is usually clearer. RankFilter is strongest when the desired operation is median cleanup, ranked extrema selection or order-statistic stylization.
When the task is ordinary soft smoothing, use Blur. When the task is impulse-noise cleanup without normal blur smear, RankFilter near 0.5 is a better conceptual fit. Other noise types may require a dedicated denoise pipeline.
A useful diagnostic chart contains white specks on black, black specks on white and one-pixel or two-pixel lines. It immediately exposes the differences between Rank 0, 0.5 and 1 and shows when Size starts destroying useful structure.
A reliable workflow is: one Image input, Size 1, Rank 0.5, prove the median cleanup, compare Rank 0 and 1, return to the minimum sufficient Size, add Effect Mask only after the filtering is understood, then verify texture and playback.
The captured Resolve Inspector used by this article confirms an intentionally tiny Controls tab containing only Size and Rank. The depth of the tool is in the algorithm, input topology and diagnostics rather than a large list of UI controls.
When to use it
Remove salt-and-pepper noise and isolated hot/dead pixels with a median-like rank
Localize dust or defect cleanup with Effect Mask
Suppress tiny bright specks with low/min-like Rank
Close small dark holes with high/max-like Rank
Condition grayscale or alpha-bearing image material before a later matte workflow
Create watercolor-like or blocky stylization with larger Size
Compare order-statistic filtering against ordinary blur
Alter tiny local structures without averaging smear
RankFilter in context
Screenshots referenced by this article. Open an image to inspect it at full size.
Example for RankFilter.
Original image