[GEM-dev] [pix_video]: issue with swapped colors

Mathieu Bouchard matju at artengine.ca
Thu May 10 05:11:35 CEST 2007


On Thu, 10 May 2007, Roman Haefeli wrote:
> On Wed, 2007-05-09 at 14:55 -0400, Mathieu Bouchard wrote:

> hm... if U=B-Y and V=R-Y, and if U and V are swapped by gem, does that
> mean, i can correct it by swapping B and R afterwards?

It would be the case if U,V was really exactly B-Y and R-Y respectively, 
but they also have special multipliers. Because, of this, the colormatrix 
you need would contain 9 non-zero values in it, which would be 
various fractions, not just ones. You could try a patch like:

[#color]
  |
[#rgb_to_yuv]
  |
[#inner (3 3 # 1 0 0 0 0 1 0 1 0)]
  |
[#yuv_to_rgb]
  |
[#reverse]
  |
[#color]

This can show you the kind of correction that you'll need.
Actually if you feed "3 3 # 1 0 0 0" instead of [#color] and replace the 
other [#color] by [#print] or [display], you'll get the matrix that you'll 
have to use the inverse of in [pix_colormatrix]. To find the inverse, you 
may use GF's [lti.MatrixInversion] or the equivalent from any other 
library (Johannes wrote at least one matrix invertor)

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada


More information about the GEM-dev mailing list