:: Re: [Frei0r] [PATCH] Add "colgate",…
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Steinar H. Gunderson
Fecha:  
A: Minimalistic plugin API for video effects
Asunto: Re: [Frei0r] [PATCH] Add "colgate", a new color correction plugin.
On Fri, Sep 14, 2012 at 05:43:47PM +0200, Marko Cebokli wrote:
> Must admit that I never really used balanc0r, so I guess I jumped too fast :-)
> Should also have read your code more carefully, now I see that you stay in
> RGB-type spaces anyway, I thought you were going to some Hxx space.


Ah, yes, certainly. I don't believe correcting in HSV makes much sense
(but visual effects might).

> The amount of difference from balanc0r is striking, could be that there is a
> bug in it, haven't read its code either...


The code is a bit complicated, but here's what I _think_ balanc0r does:
First, it takes your neutral color and then attempts to find (by binary
search) the color on the Planckian locus that matches it the closest in
blue/red ratio. (In effect, this is attempting to map the neutral color to a
color temperature, through a lookup table.)

Then, it takes that color, e.g. (0.6249, 1.000, 1.000) for 6500 K, and tries
to normalize every color component so that it is (1, 1, 1). It also applies a
“green tint” which is a simple multiplicative factor to the green component,
by default 1.2. (It seems the green tint is set _both_ by the neutral color
setting _and_ from the neutral color, which probably is a bug, at least if
you assume the video editor will always set all parameters.) After all of
this, is multiplies by a constant amount so that the smallest correction
factor is exactly 1.0 and the two other channels gets lighter.

To be honest, I'm not sure if this makes a lot of sense; it doesn't really to
me. But if others have success with it, I won't fight :-)

> All this still holds when you convert to LMS, you have to assume something.


Certainly it's an imperfect assumption. I chose LMS because it
a) subjectively gives me results that are pleasing to my eye, and b) has at
least a partial backing in the human visual system.

> REC 709 also does not use a simple power function, you would need to "de-
> gamma" anyway.


OK, I wasn't aware of this. In any case, I believe it's close enough that it
would be hard to spot the difference; the linear ramp at the bottom is
typically for numerical reasons, not visual ones.

> Anyway, I think this plugin should be included.


Thanks :-)

/* Steinar */
--
Homepage: http://www.sesse.net/