Convert Video to High-Contrast Black and White in FFmpeg

This guide explains how to convert a video to high-contrast black and white using the powerful colorchannelmixer filter in FFmpeg. By remapping and multiplying the red, green, and blue color channels, you can simulate optical lens filters, push midtones into extremes, and generate a sharp, dramatic monochrome look directly from the command line.


Understanding the colorchannelmixer Filter

The colorchannelmixer filter recalculates each output color channel (R, G, B, A) as a linear combination of all input color channels.

To convert an image to black and white, the red, green, and blue output channels must receive the exact same input mix. The parameters follow the syntax [output_channel][input_channel]:

  • rr, rg, rb: The contribution of input Red, Green, and Blue to the output Red channel.
  • gr, gg, gb: The contribution of input Red, Green, and Blue to the output Green channel.
  • br, bg, bb: The contribution of input Red, Green, and Blue to the output Blue channel.

When all three output rows are identical, color saturation drops to zero, producing a monochrome image.

Achieving High Contrast

In standard grayscale conversion (such as standard luma ITU-R BT.709), channel weights add up to 1.0 (e.g., 0.2126*R + 0.7152*G + 0.0722*B).

To generate high contrast, you can:

  1. Overdrive channel sums (values > 1.0): This clips highlights to pure white.
  2. Use negative weights: Subtracting a channel crushes shadows and deepens midtones.
  3. Emphasize contrasting spectral channels: Heavily weighting the red channel mimics a physical red contrast filter in black-and-white photography, dramatically darkening blue skies and lightening skin tones.

The Command: Red-Filter Dramatic Contrast

This command mimics a red filter combined with aggressive tone separation. It amplifies the red channel, slightly includes green, and subtracts blue to deepen shadows.

ffmpeg -i input.mp4 -vf "colorchannelmixer=rr=1.4:rg=0.2:rb=-0.4:gr=1.4:gg=0.2:gb=-0.4:br=1.4:bg=0.2:bb=-0.4" -c:a copy output.mp4

Parameter Breakdown:

  • rr=1.4, gr=1.4, br=1.4: Strong red exposure makes red elements glow and pushes brighter tones toward white.
  • rg=0.2, gg=0.2, bg=0.2: Retains necessary midtone definition from green foliage and light.
  • rb=-0.4, gb=-0.4, bb=-0.4: Negative blue darkens skies, water, and deep shadows, preventing a washed-out look.
  • -c:a copy: Copies the audio stream without re-encoding to preserve quality and speed up processing.

Alternative Mix: Blown-Out Film Noir Look

If you want a bright, high-key contrast look where midtones blow out rapidly into bright whites while retaining sharp blacks:

ffmpeg -i input.mp4 -vf "colorchannelmixer=rr=0.6:rg=0.6:rb=0.3:gr=0.6:gg=0.6:gb=0.3:br=0.6:bg=0.6:bb=0.3" -c:a copy output_noir.mp4

In this mix, the coefficients sum to 1.5 per channel. Because the sum is greater than 1.0, luminance is boosted across the entire image, forcing lighter regions into pure white and creating a stark, high-contrast monochrome aesthetic.


Fine-Tuning Your Output

  • To darken shadows further: Lower the rb, gb, and bb values deeper into negative numbers (e.g., -0.5 or -0.6).
  • To soften clipped whites: Reduce the primary positive values until the sum of the three values sits closer to 1.0 or 1.1.
  • Ensure exact matching: Always ensure that rr=gr=br, rg=gg=bg, and rb=gb=bb. If these triplets differ, color tints will bleed back into your image.