Pixopedia Documentation

Print

5.11. Color twisting

Color twisting (menu entry: Actions->Color twisting).

Color twisting action is used to perform image color adjustment by multiplying pixel color vector with predefined color twist matrix.  This action requires  Intel® Integrated Performance Primitives. Again, if you’re using one of “downgraded” Pixopedia’s versions ME or TE, this action will be disabled.

So, what is actually color twisting?

If we represent pixel colors (RGB space) as a vector, when we multiply this vector with color twist matrix, we get a new vector with new colors value:

    \[ \begin{bmatrix} R' \\ G' \\ B' \\ 1 \end{bmatrix} = \begin{bmatrix} t11 & t12 & t13 & t14 \\ t21 & t22 & t23 & t24 \\ t31 & t32 & t33 & t34 \\ 0 & 0 & 0 & t44 \\ \end{bmatrix} \begin{bmatrix} R \\ G \\ B \\ 1 \end{bmatrix} \]

Additionally, we can add some bias.
Pixopedia XE comes with bunch of predefined (internal) matrices and also with few user defined samples (items with italic font style). To create your own color twist matrix, select any matrix and double click somewhere inside Twister code. A window will pop-up:

Here, you can change matrix values, enter output filename and description. By clicking on accept button, your matrix will be saved as XML file with flt extension under userdef_xml folder. Yes, the same extension as user defined “simple 3×3 filters”, but because of different ClassName entry inside XML, Pixopedia “knows” that this is color twist matrix and not 3×3 filter.

Wait a second?

There are only 3 rows in our matrix, where is the fourth matrix row?

The fourth row is 0, 0, 0, scale. Actually, t44 element in our twist matrix is scale value.

Color twisting can be applied using strokes (all “classic” shapes are allowed) or using one of “four cats”.