selectivecolor

Watch on youtube.com
doc

https://ffmpeg.org/ffmpeg-filters.html#selectivecolor-1

reds=’1 0 0 0’

00:00:00
  • targets: pixels where the red component is the maximum

  • Adjust cyan(C): 1.0

  • Adjust magenta(M): 0.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
reds='1 0 0 0'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

reds=’0 1 0 0’

00:00:30
  • targets: pixels where the red component is the maximum

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 1.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
reds='0 1 0 0'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

reds=’0 0 1 0’

00:01:00
  • targets: pixels where the red component is the maximum

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 0.0

  • Adjust yellow(Y): 1.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
reds='0 0 1 0'
[v]"  -map '[v]' -an "${pref}_${ifnb}.mp4"

reds=’0 0 0 1’

00:01:30
  • targets: pixels where the red component is the maximum

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 0.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 1.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
reds='0 0 0 1'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

blues=’0 1 0 0’

00:02:00
  • targets: pixels where the blue component is the maximum

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 1.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
blues='0 1 0 0'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

whites=’0 1 0 0’

00:02:30
  • targets: pixels where all components are greater than 128

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 1.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
whites='0 1 0 0'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

neutrals=’0 1 0 0’

00:03:00
  • targets: all pixels except pure black and pure white

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 1.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
neutrals='0 1 0 0'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

blacks=’0 1 0 0’

00:03:30
  • targets: pixels where all components are lesser than 128

  • Adjust cyan(C): 0.0

  • Adjust magenta(M): 1.0

  • Adjust yellow(Y): 0.0

  • Adjust black(K): 0.0

The adjustment range is defined by the “purity” of the color (that is, how saturated it already is).

#! /bin/sh
ifn="Pexels_flowers.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"

#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
selectivecolor=
correction_method=absolute:
blacks='0 1 0 0'
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"