Skip to content

[filters] use updated versions of filters + add Luma Key - #6014

Closed
sandboxcoder wants to merge 1 commit into
stagingfrom
rno/filterTypes
Closed

[filters] use updated versions of filters + add Luma Key#6014
sandboxcoder wants to merge 1 commit into
stagingfrom
rno/filterTypes

Conversation

@sandboxcoder

@sandboxcoder sandboxcoder commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
  • add missing filters: Luma Key, 3-Band Eq, and Upward Compressor
  • add version 2 of all known filters that were updated
  • Run yarn test:file test-dist/test/regular/api/clipboard.js --match "Copy/paste filters between scene collections" and verify legacy filter is converted into v2 filter

Dependencies

This change is semi-related to this OSN update which filters out disabled/obsolete filters. But that change is not required for this PR.

Regression test cases for QA

This PR updates the following filters: Image Mask/Blend, Color Correction, Color Key, Sharpen, Chroma Key, Noise Suppression, and Luma Key.

This PR adds Upward Compressor (Audio filter), Luma Key Filter (Video), and 3-Band Equalizer (Audio filter)

What changed from version 1 to version 2?

Color Correction - v2 adds proper color space negotiation so the filter works correctly in SDR/WCG pipelines without mangling HDR content, whereas v1 blindly assumed GS_RGBA for everything.

Image Mask/Blend- v2 is a precision and color-pipeline upgrade — higher-resolution opacity and proper sRGB/color space awareness

Color Key Filter- v2 is a substantial rework: opacity is redesigned from an alpha-packed color hack into a proper float parameter, brightness scaling is removed, the contrast/brightness ranges are expanded, and the whole render path gains proper color space awareness.

Sharpness - only adds SRGB capability flag
Chroma Key - the chroma key v2 changes are a mirror of the color key v2 changes — opacity redesigned from an alpha-packed color hack to a proper float, brightness scaling removed, expanded ranges, and full color space pipeline awareness added.

Noise Suppression (Audio) - The change is essentially: v2 promotes RNN noise suppression as the preferred default when available, rather than only falling back to it when Speex isn't present. RNN = Recurrent Neural Network. It refers to a neural network-based noise suppression approach (specifically the https://jmvalin.ca/demo/rnnoise/ library), as opposed to the classic DSP-based Speex noise suppression.

New filters that this PR exposes

Luma Key Filer:
The luma key filter makes pixels transparent based on their brightness (luminance) rather than a specific color. It exposes four parameters:

  • Luma Min / Luma Max (0.0–1.0): defines the brightness range to key out. Pixels whose luminance falls within this range become transparent.
  • Luma Min Smooth / Luma Max Smooth: softens the edges of the key at the min/max thresholds, so the transparency transition isn't a hard cut.

For example, with default settings (luma_min=0.0, luma_max=1.0, no smoothing), nothing is keyed. If you set luma_min=0.5, pixels darker than 50% brightness become transparent — useful for removing black backgrounds or applying overlays that blend based on brightness
rather than color.

It's commonly used with white/black backgrounds or as a way to composite elements where a color-based chroma key wouldn't work.

Upwards Compressor: The upward compressor is an audio dynamics filter that boosts quiet sounds up toward a threshold, as opposed to a traditional (downward) compressor which turns loud sounds down.

How it works:

  1. Detection — measures the signal level using an RMS envelope follower (10ms window)
  2. Gain stage — for signals below the threshold, applies positive gain proportional to slope * (threshold - signal_level). Signals above the threshold get 0 gain (left untouched). The slope is 1.0 - ratio, where ratio is 0.0–1.0
  3. Knee — a soft knee (0–20 dB wide) smooths the transition around the threshold so the boost doesn't kick in abruptly
  4. Ballistics — attack and release times control how fast the gain responds
  5. Output gain — a final makeup gain stage

Parameters:

  • Ratio (0.0–1.0): how aggressively to boost quiet sounds — higher ratio = more boost
  • Threshold (-60–0 dB): the level below which boosting begins
  • Attack / Release (1–100ms / 1–1000ms): how fast the gain reacts
  • Knee width (0–20 dB): softness of the threshold transition
  • Output gain (-32–+32 dB): makeup gain applied after compression

Practical use: leveling out a quiet speaker or microphone so soft parts of speech become more audible without turning up the overall volume — the opposite problem from what a downward compressor solves. It shares the same underlying code as the expander filter, just
with is_upwcomp = true which flips the gain direction.

3 Band Equalizer: It's a simple 3-band equalizer audio filter. It splits the audio signal into three frequency bands and lets you boost or cut each by ±20 dB:

  • Low — below 800 Hz (bass)
  • Mid — 800 Hz to 5000 Hz (vocals, presence)
  • High — above 5000 Hz (air, sibilance)

How it works under the hood:

The crossover frequencies are hardcoded at 800 Hz and 5000 Hz. For each audio sample it runs two 4-pole lowpass filters in series (one tuned to 800 Hz, one to 5000 Hz) using a simple first-order IIR structure. The three bands are then derived by subtraction:

  • low = output of the 800 Hz lowpass
  • high = delayed input minus the 5000 Hz lowpass output
  • mid = delayed input minus high minus low

Each band is scaled by its gain multiplier and the three are summed back together. The EQ_EPSILON added each step prevents denormal floating-point values from causing performance issues.

It's intentionally simple — no adjustable crossover frequencies, no shelf or peak filters, just three fixed bands with gain controls.

@bundlemon

bundlemon Bot commented Jul 10, 2026

Copy link
Copy Markdown

BundleMon

Files added (4)
Status Path Size Limits
renderer.(hash).js
+7.86MB -
vendors~renderer.(hash).js
+4.67MB -
updater.js
+115.29KB -
guest-api.js
+40.23KB -

Total files change +12.67MB

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

* add missing filters (Luma Key, 3-Band Eq, and Upward Compressor
* add version 2 of all known filters that were updated
@sandboxcoder

Copy link
Copy Markdown
Contributor Author

Closing this one because it can be released as a bundle update. See bundle PR: #6018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant