change sketch panel blue

A forum dedicated to George scripting questions
Post Reply
User avatar
slowtiger
Posts: 2949
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

change sketch panel blue

Post by slowtiger »

My workflow is quite speedy with key commands for "make blue", "erase blue" and "make black" from the sketch pannel. But I found that this blue is too opaque when used for inbetweenig with light table. I tried to make it 50% opaque:

Duplicated the "make blue" action to a new panel, then edited the tv_pixelmatrix values. With lots of trial and error I found that changing the last group of values to 0 0 0 0.25 0 gave me a half transparent blue, but with a different hue. Worked so far (could erase it), but it would be nice to keep the original hue.

Unfortunately the George documentation is highly secretive about what those values mean:

Code: Select all

tv_pixelmatrix iR1 iG1 iB1 iA1 iK1 iR2 iG2 iB2 iA2 iK2 iR3 iG3 iB3 iA3 iK3 iR4 iG4 iB4 iA4 iK4 [0|1]
I guessed the "A" stands for alpha? Would be nice to have some examples for different colours and transparencies, and what the command really does - changes which part into which other part?
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
User avatar
Thierry
Site Admin
Posts: 2780
Joined: 07 Jan 2013, 08:28

Re: change sketch panel blue

Post by Thierry »

Hello Markus,

The "A" does stands for Alpha indeed.
As for how to use it, I've never used it, but Peter Wassink has an example here
User avatar
Peter Wassink
Posts: 4436
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: change sketch panel blue

Post by Peter Wassink »

Yes this is not intuitive. Nested arrays of color and alpha channels :? ... they make my brain hurt...
but if you keep it simple it can be very usefull....
And you can find more info on the site: https://www.tvpaint.com/doc/tvp11/index ... ixelmatrix
tv_pixelmatrix iR1 iG1 iB1 iA1 iK1 iR2 iG2 iB2 iA2 iK2 iR3 iG3 iB3 iA3 iK3 iR4 iG4 iB4 iA4 iK4 [0|1]

Apply a matrix on the current image

[PARAMETERS]
iR1 iG1 iB1 iA1 iK1 int int int int int The coefficients
iR2 iG2 iB2 iA2 iK2 int int int int int The coefficients
iR3 iG3 iB3 iA3 iK3 int int int int int The coefficients
iR4 iG4 iB4 iA4 iK4 int int int int int The coefficients
0|1 bool Unmultiply colors before applying the matrix

[EXAMPLE]
Here is how it basically works :
you have 4 groups : R G B A
In each group, you have 5 numbers : r g b a k
The 4 firsts numbers are factors which determines how much the channel of the current color will impact on the final channel.

For example, if in my pixel I want to use the value of the blue channel as the value of the red, I'll do this in the first group (R):
R
r g b a k
0 0 1 0 0

If I want a channel to keep the same value, I'll do this:
R
r g b a k
1 0 0 0 0

So in my example, if I only want to change the red value, I need to do this:
R G B A
r g b a k r g b a k r g b a k r g b a k
0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0

The 'k' value is constant which is added to the result.
Second example, let's say I have these color values:
R = 255
G = 100
B = 255
A = 255

I want the red to have the green value +50, so I do this:
R
r g b a k
0 1 0 0 50

And if I want the red to have the green value -50, I do this:
R
r g b a k
0 1 0 0 -50

Here's my complete sequence for the second example:
R G B A
r g b a k r g b a k r g b a k r g b a k
0 1 0 0 50 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0

The result will be:
R = 150
G = 100
B = 255
A = 255
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
User avatar
slowtiger
Posts: 2949
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: change sketch panel blue

Post by slowtiger »

Woah, thank you!
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
Post Reply