FUSION · FULL ARTICLE
RankFilter
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.
Overview
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
Article screenshots
Inputs & outputs
RankFilter: Image + optional Effect Mask → filtered Image
RankFilter has ordinary 2D image-processor topology but unusual math: Image supplies the neighborhood samples, optional Effect Mask only limits coverage of the computed filter, and Output remains an image stream.
Sorts nearby pixels by value and replaces the current pixel with the sample at the selected Rank; Size controls the local neighborhood.
Inputs
- Image
Primary image / ranked samples
Receives: A 2D RGBA image from MediaIn, Merge, Background, Loader or another image node.
Inside the node: Pixels from this raster form the local neighborhood that is sorted by value at every output location.
Typical sources: MediaIn · Merge · Background · Loader · Fast Noise
This is the actual sample source for RankFilter. Do not confuse Image with the blue Effect Mask; the two inputs have different roles.
- Effect Mask
Optional area-of-effect mask
Receives: A single-channel Rectangle, Ellipse, Polygon, B-Spline, Bitmap or other mask node.
Inside the node: The mask limits coverage of the already-computed RankFilter result: filtered pixels appear inside coverage while the original Image remains outside.
Typical sources: Rectangle · Ellipse · Polygon · B-Spline · Bitmap
Effect Mask does not contribute pixels to the neighborhood and is not a second image source for ranking.
Outputs and destination
Output
A 2D RGBA image after rank-based local filtering and optional mask coverage.
Next step: MediaOut · Merge → Foreground · Color Corrector · Blur / Sharpen · next image processor
Output already contains the filtered result. Keep the original on a separate branch when a before/after composite is required.
- Output
- 2D image after local rank filtering and, when connected, Effect Mask coverage.
Processing order
- Image supplies the source 2D RGBA raster.
- For each output pixel RankFilter gathers a local neighborhood controlled by Size.
- Neighbor samples are ordered by value and Rank chooses a position from minimum through median to maximum.
- The selected ranked pixel becomes the local result instead of averaging neighbors as Blur would.
- Optional Effect Mask limits where the filtered result is applied to the original Image.
- Output remains a normal 2D image for MediaOut, Merge or another image processor.
Localized hot-pixel cleanup
MediaIn.Output → RankFilter.Image · Ellipse.Mask → RankFilter.Effect Mask · RankFilter.Output → MediaOut.Input
Image supplies pixels for local ranking, Ellipse only limits the repair area, and Output remains a normal image stream.
RankFilter = Image samples → value-ranked selection → optional mask coverage → Image Output. Effect Mask is not a second sample source.
Parameters
RankFilter · Inspector reference
Start with the two effect controls: Size chooses the local neighborhood and Rank chooses the ordered sample. The separate Effect Mask limits where the result contributes. Compare a known texture and its edges before combining these adjustments.
- Image
- 2D source pixels
- Size
- local neighbourhood in pixels
- Sort
- pixels ordered by value
- Rank
- min ↔ median ↔ max
- Mask
- optional Effect Mask coverage
- Output
- filtered 2D image
Neighborhood · Sampling neighborhood
Size controls how wide a local neighborhood participates in sorting. Small Size suits cleanup; large Size quickly alters texture.
- Size
Neighborhood > SizeSets the sampled local neighborhood size in pixels. Blackmagic describes Size 1 as the immediate-neighbor case. Increasing Size widens the neighborhood. Small values are useful for salt-and-pepper cleanup, while large values rapidly alter texture and can produce a watercolor-like result.
Check / distinguish: Start at 1 and increase only until the defect is removed. Inspect fine lines, hair and skin at 100% before accepting a larger value.
- Size is pixel-domain neighborhood
Controls > SizeSize defines the local sampling area in pixels, not a normalized radius or blur percentage.
Check / distinguish: Compare Size 1 and 2 on one-pixel test dots at the same Rank.
- Size 1 baseline
Controls > Size = 1Blackmagic describes Size 1 as the immediate-neighbor case; it is the right diagnostic starting point.
Check / distinguish: Start at 1 and increase only if the defect survives the local window.
- Small Size targets impulse noise
Controls > SizeSmall values are especially suited to salt-and-pepper/hot-pixel cleanup where the defect is local.
Check / distinguish: On a 1–2-pixel defect compare Size 1 with a larger value and judge texture loss.
- Large Size becomes structural
Controls > SizeA large neighborhood starts changing real texture and broad structures; the historical reference notes a watercolor-like result.
Check / distinguish: Increase Size on a test chart and note when thin lines begin to disappear.
- Size before stylization
Workflow > SizeFor cleanup stop at the minimum sufficient Size; for a watercolor look treat the larger Size as a separate artistic intent.
Check / distinguish: Save two variants: cleanup-minimum and stylized-large; do not mix the goals.
Rank · Ordered-sample selection
Rank selects a position in the ordered neighborhood: 0 lowest, 0.5 median-like, 1 brightest.
- Rank
Rank > RankSelects a position in the ordered neighborhood: 0 = lowest value, 1 = brightest value. Around 0.5 the result is median-like. Rank 0 behaves like a local minimum and tends to suppress tiny bright extrema; Rank 1 behaves like a local maximum and tends to close small dark extrema or expand bright structures.
Check / distinguish: Start at 0.5 for impulse-noise cleanup. Move toward 0 or 1 only deliberately and watch useful geometry, not only the defect.
- Rank is ordered position
Controls > RankRank is neither opacity nor amount. It selects a sample position in the sorted local set.
Check / distinguish: At fixed Size compare 0, 0.5 and 1—the effect changes character rather than only intensity.
- Rank 0 = lowest
Controls > Rank = 0The documented lowest-value selection gives min-like behavior and can erode small bright structures.
Check / distinguish: Check a white dot and a thin white line on black.
- Rank 0.5 = median case
Controls > Rank ≈ 0.5Middle-rank selection corresponds to median behavior and clearly demonstrates impulse-noise cleanup without averaging blur.
Check / distinguish: Compare isolated black/white specks with an ordinary Blur of similar visual width.
- Rank 1 = brightest
Controls > Rank = 1The documented brightest-value selection gives max-like behavior, expanding bright structures and closing small dark holes.
Check / distinguish: Check a black dot inside a white field and the edge of a bright rectangle.
- Intermediate ranks are useful
Controls > Rank between extremaValues between min/median/max let you bias local selection without jumping to a full extreme mode.
Check / distinguish: At one Size try 0.35 and 0.65 and compare them with 0.5.
- Rank changes geometry risk
Controls > RankExtreme ranks can move local boundaries of bright/dark shapes; this is not merely a denoise-strength change.
Check / distinguish: Track a 1–2 px line width before/after an extreme rank.
Guide › Connections · Connections and data types
Trace the input data, processing and compositing path.
- Effect Mask is a separate input
Flow > Effect MaskThe optional blue Effect Mask limits the area of effect after rank filtering.
Check / distinguish: Connect an Ellipse and verify the image outside coverage remains original.
- Mask does not join the sample set
Flow > Effect MaskMask pixels are not sorted together with Image pixels; they control coverage.
Check / distinguish: Change mask shape at fixed Size/Rank and verify the filter character inside coverage does not change by itself.
- Tune first, localize second
Workflow > Effect MaskFor diagnostics first prove Size/Rank without a mask, then localize the repair.
Check / distinguish: Compare the unmasked baseline, then connect the mask without changing controls.
- Mask edge can reveal texture mismatch
Workflow > Effect Mask edgeAn overly tight mask around a strong extreme-rank filter can read as a patch because of texture mismatch.
Check / distinguish: Broaden/soften the mask and inspect the transition at 100% in playback.
Guide › Application · Application and limits
Choose operation order and test material to match the task.
- RankFilter is not Blur
Concept > Rank vs averagingBlur averages samples; RankFilter chooses one ranked sample. A similar apparent radius produces different edge/texture behavior.
Check / distinguish: Place Blur and RankFilter on duplicate branches and compare an isolated speck plus sharp edge.
- Median is not universal denoise
Workflow > Noise typeMedian-like filtering is best suited to impulse noise; fine grain, chroma noise or structured compression may need another denoiser.
Check / distinguish: If Rank 0.5 barely helps, do not endlessly increase Size—classify the noise.
- RankFilter is not ErodeDilate
Concept > MorphologyRank 0/1 have min/max-like visual consequences, but RankFilter has a different control model and algorithmic framing from dedicated ErodeDilate.
Check / distinguish: For a matte edge compare the same target result through both nodes and judge control predictability.
- Name nodes by intent
Flow > Node labelMedianCleanup / BrightSpeckMin / DarkHoleMax communicate the chosen Rank intent faster than generic RankFilter1.
Check / distinguish: Rename the node and see whether the flow remains understandable without opening the Inspector.
Guide › Result checks · Result checks
Compare source and output, checking the relevant channels and multiple frames.
- 100% Viewer is mandatory
Viewer > 100%Fit view can hide thin-line loss, blocky texture and local patching.
Check / distinguish: Inspect the defect and neighboring details at 100% before final approval.
- Playback catches temporal popping
Timeline > PlaybackLocal ranking is recomputed frame by frame; changing neighborhoods can cause popping/crawling.
Check / distinguish: Review at least 20–30 frames around the repair.
- Check alpha separately
Viewer > AlphaOn transparent graphics RGB can look fine while the alpha edge has changed.
Check / distinguish: Compare RGB Viewer and Alpha Viewer after an extreme Rank.
Before adjusting the node
- RankFilter does not average neighbors like Blur; it selects one ranked pixel sample from the local neighborhood.
- Rank 0 is the lowest value, Rank 1 the brightest, and around 0.5 is the median case.
- Size 1 is the immediate-neighbor starting case in the Blackmagic reference; larger values use a wider area.
- Small Size is recommended for salt-and-pepper noise; large Size can create watercolor-like flattening.
- Rank 0/1 are useful extrema modes, but they can change the geometry of bright/dark structures.
- The node has two inputs: the primary Image and optional blue Effect Mask.
- Effect Mask limits coverage and is not a second image source for sorting.
- The illustrated Controls panel contains Size 1 and Rank 0.5; compare these two parameters separately.
- Judge the result at 100% and in playback or texture loss and temporal popping are easy to miss.
Reference documentation
- Blackmagic Design · Fusion Visual Effects
Official Blackmagic learning material for Fusion logic, masks, compositing and core tools.
- Blackmagic Design · DaVinci Resolve support
Current Resolve/Fusion manuals and support material. Exact control names and placement can vary by version.
Examples
Median cleanup without ordinary blur
Prove the basic order-statistic behavior: Size 1 + Rank 0.5 removes isolated extrema while preserving edges differently from averaging blur.
Starting conditions
DaVinci Resolve / Fusion Target: Resolve 21/21.1; RankFilter behavior cross-checked against Blackmagic Rank Filter documentation and the captured Inspector bundled with this article · Free / Studio where the classic Rank Filter node is available · Cross-platform editorial reference; live Resolve execution not run in this package
1920 × 1080 · 24 fps · 144 frames · Fusion 2D RGBA image workflow; RankFilter sorts local pixels by value and outputs the selected ranked pixel color
- DaVinci Resolve / Fusion
- MediaIn, RankFilter, optional Ellipse, MediaOut
Source material
- SRC
A frame with isolated bright and dark specks over a smooth region and thin useful lines to check detail loss.
Download the test source or prepare your own matching the description. Import it into the Media Pool and drag it into Fusion as SRC. For a clip provide 144 frames at 24 fps. Static artwork may be held across the range; the input used to test motion, flicker or frame history must contain actual footage.
Nodes and connections
SRC— Source image · MediaInRF— RankFilter · RankFilterOUT— MediaOut · MediaOut
| Source | Destination | Data |
|---|---|---|
Source image (SRC)Output | RankFilter (RF)Image | image |
RankFilter (RF)Output | MediaOut (OUT)Input | image |
Graph output: MediaOut (OUT)
Parameter values
- RankFilter (RF) / Controls / Size
1Use the documented immediate-neighbor starting case.
- RankFilter (RF) / Controls / Rank
0.5Use the median/middle-rank case for salt-and-pepper style cleanup.
- RankFilter (RF) / Controls / Rank
0Expose min-like behavior for comparison.
- RankFilter (RF) / Controls / Rank
1Expose max-like behavior for comparison.
Reproduce the example
- Build MediaIn → RankFilter → MediaOut without a mask and view at 100%.
First prove the image filter itself without extra variables.
Check: RankFilter receives one Image and produces a normal image Output.
- Set Size 1 and Rank 0.5; compare On/Bypass on isolated bright/dark pixels.
0.5 is the middle-rank/median case and Size 1 is the smallest documented local-neighborhood starting point.
Check: Isolated extrema are reduced without the typical Gaussian-style smear across the whole edge.
- Without changing Size, switch Rank to 0 and inspect bright specks/thin white lines.
Rank 0 selects the lowest value and exposes the min-like risk to bright geometry.
Check: Small bright islands shrink or disappear more aggressively than with the median case.
- Set Rank 1 at the same Size and compare small dark holes.
Rank 1 selects the brightest value and exposes max-like behavior.
Check: Bright structures expand and small dark gaps close more aggressively.
- Return Rank to 0.5 and review 20–30 frames of playback.
Cleanup must remain temporally stable rather than looking good on one hero frame.
Check: Defects are reduced while useful texture does not pop or turn into blocky patches.
Expected result
- MediaOut (OUT) · frame 72
At Size 1 / Rank 0.5 isolated impulse noise is reduced; Rank 0 and 1 clearly expose the min/max-like extremes and their geometry risks.
Alpha: On sources with transparency inspect Alpha Viewer separately; the RGB check does not automatically prove clean alpha.
When the result differs
- The image becomes plastic or blocky.
Cause: Size is too large for a restoration task.
Correction: Return Size to 1 and increase only to the minimum required value.
- The median case barely helps the noise.
Cause: The noise is not impulse/salt-and-pepper type or the defect is wider than the local neighborhood.
Correction: Try a different denoise workflow or cautiously increase Size and reassess detail.
Files for the example
References
- Blackmagic Design — The Visual Effects Guide to DaVinci Resolve 20
Fusion image-flow conventions used for MediaIn, MediaOut and standard mask-node wiring in the practice graphs.
- Blackmagic Design — Fusion 9 Tool Reference: Rank Filter
Filter Tools > Rank Filter Tool: local pixel sorting, Size in pixels, Rank 0 lowest / 1 brightest, median behavior and salt-and-pepper guidance.
- Blackmagic Design — DaVinci Resolve 18 Reference Manual: Rank Filter Node
Fusion Page Effects > Filter Nodes > Rank Filter: main 2D image input plus optional Effect Mask and standard image output.
Localized min/max cleanup with Effect Mask
Use the second blue Effect Mask input so extrema-based RankFilter changes only the problem area of the frame.
Starting conditions
DaVinci Resolve / Fusion Target: Resolve 21/21.1; RankFilter behavior cross-checked against Blackmagic Rank Filter documentation and the captured Inspector bundled with this article · Free / Studio where the classic Rank Filter node is available · Cross-platform editorial reference; live Resolve execution not run in this package
1920 × 1080 · 24 fps · 144 frames · Fusion 2D RGBA image workflow; RankFilter sorts local pixels by value and outputs the selected ranked pixel color
- DaVinci Resolve / Fusion
- MediaIn, RankFilter, optional Ellipse, MediaOut
Source material
- SRC
A frame with isolated bright and dark specks over a smooth region and thin useful lines to check detail loss.
Download the test source or prepare your own matching the description. Import it into the Media Pool and drag it into Fusion as SRC. For a clip provide 144 frames at 24 fps. Static artwork may be held across the range; the input used to test motion, flicker or frame history must contain actual footage.
Nodes and connections
SRC— Source image · MediaInMASK— Ellipse · EllipseMaskRF— RankFilter · RankFilterOUT— MediaOut · MediaOut
| Source | Destination | Data |
|---|---|---|
Source image (SRC)Output | RankFilter (RF)Image | image |
Ellipse (MASK)Mask | RankFilter (RF)EffectMask | mask |
RankFilter (RF)Output | MediaOut (OUT)Input | image |
Graph output: MediaOut (OUT)
Parameter values
- RankFilter (RF) / Controls / Size
1Keep the neighborhood minimal while localizing the operation.
- RankFilter (RF) / Controls / Rank
0Use min-like selection for an isolated bright-speck example.
- RankFilter (RF) / Controls / Rank
1Use max-like selection for an isolated dark-hole example.
Reproduce the example
- Connect MediaIn to RankFilter.Image, Ellipse.Mask to RankFilter.Effect Mask, and Output to MediaOut.
Image carries the pixels to be ranked; Effect Mask only limits operation coverage.
Check: RankFilter has both its main image input and separate blue mask input connected; the mask does not replace the source.
- Place the Ellipse over an isolated bright defect, set Size 1 / Rank 0, and compare the mask On/Off.
Low Rank can remove a bright speck but the extreme mode is risky for useful bright detail, so it is localized.
Check: The defect changes only inside the Ellipse while the rest of the frame texture remains original.
- For a dark hole keep the same graph and switch Rank to 1.
High Rank selects brighter local values and demonstrates the opposite extrema case.
Check: A small dark gap closes inside the mask while bright edges outside it do not expand.
- Expand the Ellipse slightly beyond the defect and inspect the mask boundary in playback.
An overly tight mask can reveal local texture differences as a visible patch.
Check: The treatment boundary does not read as a separate patch on neighboring frames.
Expected result
- MediaOut (OUT) · frame 72
RankFilter affects only the Effect Mask region: low Rank locally suppresses bright extrema, high Rank locally closes dark extrema, and the rest of the image stays untouched.
Alpha: Effect Mask controls filter coverage and is not a second image branch. On alpha-bearing sources inspect the composited edge separately.
When the result differs
- The whole frame changes even though Ellipse is connected.
Cause: The mask is not connected to Effect Mask or the flow wiring is wrong.
Correction: Verify the blue Effect Mask connector and view the Ellipse output directly.
- A visible patch appears around the repair.
Cause: The extreme Rank changes texture too strongly or the mask is too tight.
Correction: Try a Rank closer to 0.5, a smaller Size and/or broader softer mask coverage.
Files for the example
References
- Blackmagic Design — The Visual Effects Guide to DaVinci Resolve 20
Fusion image-flow conventions used for MediaIn, MediaOut and standard mask-node wiring in the practice graphs.
- Blackmagic Design — Fusion 9 Tool Reference: Rank Filter
Filter Tools > Rank Filter Tool: local pixel sorting, Size in pixels, Rank 0 lowest / 1 brightest, median behavior and salt-and-pepper guidance.
- Blackmagic Design — DaVinci Resolve 18 Reference Manual: Rank Filter Node
Fusion Page Effects > Filter Nodes > Rank Filter: main 2D image input plus optional Effect Mask and standard image output.
Other outlines from the article
Median hot/dead-pixel cleanup
Size 1 and Rank 0.5 provide a clear starting point for impulse-noise cleanup without ordinary averaging blur.
- MediaIn
- RankFilter: Size 1 / Rank 0.5
- MediaOut
Localized bright-speck removal
After a low Rank is chosen, Ellipse or Polygon is connected to Effect Mask so only the defect region is filtered.
- MediaIn → RankFilter.Image
- Ellipse/Polygon → RankFilter.Effect Mask
- RankFilter → MediaOut
Close small dark holes
A high Rank favors brighter neighbors and can close tiny dark gaps inside a bright structure when Size is kept minimal.
- Source image
- RankFilter: high Rank
- Inspect edge/alpha
- Next image effect
Watercolor-like stylization
A larger Size intentionally removes fine texture and groups the image into broader local value regions.
- MediaIn
- RankFilter: larger Size
- ColorCorrector (optional)
- MediaOut
Mistakes
- Treating RankFilter as an ordinary blur and expecting averaged soft smear.
- Ignoring the optional Effect Mask and filtering the full frame for one local defect.
- Treating Rank as opacity or strength instead of an ordered-neighborhood position.
- Treating Rank 0.5 as an arbitrary look preset instead of the median case.
- Using Rank 0 and missing the fact that useful thin bright details are shrinking too.
- Using Rank 1 and missing bright-edge expansion or the loss of useful dark gaps.
- Increasing Size until the defect disappears without watching texture loss.
- Judging only in Fit view and missing blocky or watercolor degradation.
- Approving one still frame without checking temporal stability.
- Treating Effect Mask as a second image source participating in ranking.
- Assuming any blue mask stream is automatically equivalent to an image input in a matte pipeline.
- Using RankFilter instead of ErodeDilate when explicit morphology controls are the real requirement.
- Using large Size on faces or hair and trying to restore texture afterward with sharpening.
- Changing Size and Rank simultaneously and losing the ability to diagnose which change damaged detail.
- Judging cleanup only by the removed defect instead of neighboring real pixels.
- Forgetting Alpha Viewer on transparent graphics.
Tips
- Learn the node on a test chart containing black/white specks and thin lines; Rank 0/0.5/1 become immediately obvious.
- Size 1 plus Rank 0.5 is the cleanest baseline for understanding median behavior.
- Change one control at a time: Rank first at fixed Size, then Size at the chosen Rank.
- For restoration, the smallest sufficient Size usually wins over the cleanest-looking still frame.
- Add Effect Mask after the algorithm is tuned so mask coverage is not confused with filter behavior.
- Review 20–30 frames when working on noisy footage.
- Use Rank 0 and 1 as diagnostic extrema modes to reveal which structures are at risk.
- If median behavior does almost nothing, the noise may not be impulse noise; consider a different denoise approach before simply increasing Size.
- Use large Size on a separate stylization branch rather than mixing artistic blockiness with restoration cleanup.
- Compare RankFilter against ErodeDilate side-by-side for matte/alpha-related tasks because similar-looking results come from different math.
- Make local Effect Masks slightly wider than a single defect and inspect the transition at 100%.
- Rename nodes by intent—MedianCleanup, BrightSpeckMin, DarkHoleMax—so the chosen Rank logic is visible in the Flow.
- Save a baseline before extreme ranks; min/max behavior can alter geometry more than a small preview suggests.
- Inspect the RankFilter output before downstream color/blur nodes when troubleshooting a larger chain.
Workflow order
- Connect one MediaIn or other 2D image to RankFilter.Image and route RankFilter.Output to MediaOut or the next image processor.
- Use Size 1 and Rank 0.5 as the baseline.
- Inspect the Viewer at 100% and identify both isolated defects and useful fine detail.
- Compare Bypass with Rank 0.5; impulse noise should reduce without ordinary Gaussian-style smear.
- Without changing Size, temporarily set Rank to 0 and inspect bright specks and thin white detail.
- Set Rank to 1 at the same Size and inspect dark holes and bright-edge growth.
- Return Rank to the value that actually matches the task—typically near 0.5 for median cleanup and near the extremes only for intentional min/max behavior.
- Increase Size one step at a time and compare both the defect and real texture after every change.
- Stop at the smallest Size that solves the problem; do not use a wide neighborhood simply because it looks cleaner on one frame.
- Review neighboring frames and playback to catch temporal popping or crawling.
- If the filter is needed only in one area, connect Rectangle, Ellipse or Polygon to Effect Mask after Size/Rank are proven.
- Inspect the Effect Mask edge and make sure the repaired region does not read as a texture patch.
- For localized repair, broaden or soften the mask only as much as needed rather than compensating for a poor Rank choice.
- For dark-hole cleanup, compare high Rank with ErodeDilate and keep whichever preserves shape better.
- For bright-speck cleanup, compare low Rank against the median case; the median often removes outliers with less structural damage.
- If large Size creates a watercolor/blocky look, decide whether that is intentional stylization or overprocessing.
- On transparent graphics, inspect Alpha Viewer and the composited edge as well as RGB.
- Before final output, review 100% detail, playback and On/Off comparisons for defect removal, texture and mask-boundary visibility.
