Am 23.01.2021 um 18:24 schrieb Simon Taylor:
Question: Is there a way to make ffmpeg's colorchannelmixer use perceptual
gamma?

Background: I'm trying to salvage source H.264 video from a capture device
(8mm film scanner) which seems to have an extreme saturation issue that
often leaves the red and green channels saturated with minimal blue,
leaving a bright yellow stain on that area of the frame.
https://i.imgur.com/6Qh6PRk.png

Editing a single frame capture of the video in GIMP, I see that if I use
the Colours -> Components -> Channel Mixer tool and supplement the blue
channel (1.0) with the green channel (1.0) https://i.imgur.com/Q0qqgSP.png
the result is desaturated but usable https://i.imgur.com/t19QU4U.png

I've attempted to replicate this using ffmpeg's colorchannelmixer with the
same values (output blue = 1.0*blue + 1.0*green)

Code: https://pastebin.com/raw/czS76ZrN

but the result has a blue tint. https://i.imgur.com/TsnBKb2.png

Looking at the RGB values, ffmpeg's behaviour is technically correct (the
processed B channel is an exact sum of the source B and G channels), but
GIMP's behaviour is what I need.

GIMP's behaviour is described in
https://graphicdesign.stackexchange.com/questions/136750/gimp-channel-mixer-does-not-work-as-expected
and gamma correction is suggested as the likely difference in how GIMP
reaches its result.

If you know the mathematical formula, you can realize that in FFmpeg with the geq filter. But it's slow.

Michael

_______________________________________________
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to