## Displaying colors using jit.matrix

This example shows how to show a color on **jit.pwindow** by using **jit.matrix**.

This example shows how to show a color on **jit.pwindow** by using **jit.matrix**.

This example shows how to use **jit.matrix** to randomly alter the color of horizontal bars displayed in a **jit.pwindow** after a fixed delay.

This example uses **jit.change** to report when a **jit.matrix** object is altered.

This example shows you a way to center an image file in **jit.window** (or **jit.world**), while retaining the original dimensions of the image.

This example shows a way to divide your list into three-item groups with **zl.group**, then put each of those values into one of the three planes of **jit.matrix**.

To output matrix values to a number box, use **metro 1000** to bang a **counter** object, and use that output as the matrix coordinate for the *getcell *message. Please note that the third outlet of **counter** does not send out a bang unless you tell it to (with a *carrybang* message). It sends out a 1 when the **counter** reaches its maximum, and a 0 on the next output. This causes a double trigger.

To calculate the mean value of each cell of a series of Jitter matrices, you can keep the running sums in a matrix, and then divide by the number of instances received. That is, use **jit.+** to keep the sum of all matrices received, use a **counter** to keep track of how many matrices you’ve received, and use **jit./** to divide by that number (or **jit.*** to multiply by one over that number). In this example, a subpatch generates fake input data, and the rest of the patch shows the procedure for calculating the mean.

The term "upsample" is used in digital audio and video to mean increasing the sampling resolution of a sound or an image. More generally the term can be used to mean increasing the size of a set of numbers by some factor, keeping the original numbers and using interpolation to determine the values of the new intermediate numbers.

This example demonstrates how to use an alpha channel to reveal certain sections of an image. Refer to Tutorial 29: Using the Alpha Channel.

This example shows a way to set the contents of a 2D Jitter matrix. The task in this case is to fill the matrix with a checkerboard pattern of alternating black and white squares, which is to say alternating *0* and *1* cells.