Re: [FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-24 Thread Simon Taylor
On Sat, 23 Jan 2021 at 21:34, Paul B Mahol  wrote:

> On Sat, Jan 23, 2021 at 6:32 PM Simon Taylor 
> wrote:
>
> > Question: Is there a way to make ffmpeg's colorchannelmixer use
> perceptual
> > gamma?
> >
>
> Added pl option to colorchannelmixer. It is designed to preserve overall
> rgb lightness.
> Its behavior is similar but not exact with gimp. So with your input using
> also pl=1 option
> will remove blue tint.
> You need latest ffmpeg build with that commit included.
>

Wow, that was a lot of effort to go to for what may be an obscure corner
case. Thanks very much, I'll compile and test. Much appreciated!

Simon
___
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".

Re: [FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-23 Thread Paul B Mahol
On Sat, Jan 23, 2021 at 6:32 PM Simon Taylor 
wrote:

> Question: Is there a way to make ffmpeg's colorchannelmixer use perceptual
> gamma?
>

Added pl option to colorchannelmixer. It is designed to preserve overall
rgb lightness.
Its behavior is similar but not exact with gimp. So with your input using
also pl=1 option
will remove blue tint.
You need latest ffmpeg build with that commit included.


>
> 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.
>
> Thanks,
>
> Simon
> ___
> 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".
___
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".

Re: [FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-23 Thread Carl Zwanzig

On 1/23/2021 11:36 AM, Paul B Mahol wrote:

Why you must always recommend alternative crappy solutions here?


Why must you always dismiss anything that isn't CLI ffmpeg that might solve 
the user's issue? Resolve is _highly_ regarded software, and one of the 
better choices for colour correction. And why do dismiss these without even 
a hint of why they're "crappy"? And when you do dismiss an idea or 
suggestion, you never seem to provide an alternative. If you don't have one, 
then the "crappy" opinion has no weight.


z!
___
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".

Re: [FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-23 Thread Paul B Mahol
On Sat, Jan 23, 2021 at 8:29 PM Phil Rhodes via ffmpeg-user <
ffmpeg-user@ffmpeg.org> wrote:

>  > 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'd be a little cautious about this; have you tried it on other subjects?
> If it's just this clip then fine - I suspect your proposed solution is
> working well because the gate is actually supposed to be white. What you've
> created here is sort of a riff on very early two-colour film systems which
> used red and green; they sort of work in the same way this sort of works,
> giving a quasi-reasonable rendition of skin tones and foliage.
> If you have other situations, though, where you have subjects that are
> supposed to be just green, they'll end up cyan. I'm surprised it isn't more
> visible on the plants.
> I'd gently suggest that something like Resolve (free version available for
> major platforms) which allows you to get creative in how and where this
> stuff is applied.
>

Why you must always recommend alternative crappy solutions here?


> P
> ___
> 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".
___
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".

Re: [FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-23 Thread Phil Rhodes via ffmpeg-user
 > 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'd be a little cautious about this; have you tried it on other subjects? If 
it's just this clip then fine - I suspect your proposed solution is working 
well because the gate is actually supposed to be white. What you've created 
here is sort of a riff on very early two-colour film systems which used red and 
green; they sort of work in the same way this sort of works, giving a 
quasi-reasonable rendition of skin tones and foliage.
If you have other situations, though, where you have subjects that are supposed 
to be just green, they'll end up cyan. I'm surprised it isn't more visible on 
the plants.
I'd gently suggest that something like Resolve (free version available for 
major platforms) which allows you to get creative in how and where this stuff 
is applied.
P  
___
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".

Re: [FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-23 Thread Michael Koch

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".

[FFmpeg-user] colorchannelmixer: perceptual gamma

2021-01-23 Thread 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.

Thanks,

Simon
___
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".