Jitter

Replaceable white mask

If you have a video that you first want it masked by a white background, and uncover the video as lines are drawn into it, you can use a jit.lcd with a white background, draw into it with black lines, and add that to your video. All the pixels that are white (255 255 255) in your jit.lcd matrix will be white in the summed output, and all the pixels that are black (0 0 0) in the jit.lcd will not affect the video.

Blur a float32 matrix

To blur an image in a Jitter matrix, one cheap and easy way is to downsample the image, then re-upsample it with interpolation. Another common method, though a little more computationally expensive, is to use convolution, effectively replacing each pixel with a weighted combination of its surrounding pixels.This example shows how to blur a float32 matrix using jit.convolve.

32-bit versus 64-bit

64-bit precision is useful for when you need, well, more precision. This is important when you’re dealing with extremely small or extremely large numbers. You can’t necessarily create those numbers as a Max message, but they can be the result of math inside Max objects, and that’s where errors can occur. Here’s an example that shows how the Max messages int and float (32-bit) can fail to deal with very large numbers correctly, while the float64 data type in Jitter should deal with them correctly.

Adjust brightness and contrast on a 1-plane char matrix

Brightness and contrast are explained briefly in Jitter Tutorial 7: Image Level Adjustment. The common Jitter object for adjusting brightness, contrast, and saturation of an image is jit.brcosa. You might wonder, though, what math is used to adjust brightness and contrast. Brightness is just multiplication, so you could simply use the jit.op object with @op * as the argument (or the equivalent jit.*).

Create a stop motion effect using jit.qt.movie

To create a stop motion effect, calculate the ratio of the movie’s framerate to your desired (stopframe) framerate. Use that value to calculate a metro interval. Then move ahead the desired number of frames with each bang of the metro. In order to avoid any errors caused by using int instead of float, calculate and store the current frame number as a float (outside of the jit.qt.movie object). Finally, send a frame message to jit.qt.movie.