Repeat only selected region of an image jit.gl.pix
Hello,
I'm trying to figure out how to sample only select pixels within jit.gl.pix
Say I want to use an snorm scaled up to have a repeat effect, but I only want the to happen with a certain part of the image not to take the whole part of the image.
Can I repeat only a select part of the image using a sample parameter...or is there another simpler way to do this?
Hey Noah,
something like this might work:
that's a cool patch...not exactly what I'm looking for though.
Here's an easier way to explain. Say I'm using a mask on an image and only want the masked part of the image repeated. In your patch the entire image is still getting repeated
Like so?
Matteo's example does exactly what you are describing, you just need to adjust the rsliders to define the masked part of the image.
Hi there. These patches have been a real help. I'm keen to enact a mirror repeat on the cropped & zoomed area but I'm struggling with how the right inlet of 'sample' works. Any tips greatly appreciated.
Hi Dunk,
the right inlet of [sample] takes a 2-component vector representing the normalized position (aka between 0 and 1) at which the image coming into the first inlet is sampled.
The attribute @boundmode affects the sampling coordinates ONLY when they exceed the range [0, 1].
Some examples:
given input sampling coordinates x = -0.1 and y = 1.3
@boundmode wrap (default) -> x = 0.9; y = 0.3
@boundmode clamp -> x = 0; y = 1
@boundmode mirror -> x = 0.1; y = 0.7
Since your patch samples a subregion of the original video, the sampling coordinates never exceed the range [0, 1].
If you want to have mirrored sampling, you must implement it manually. This could be a way to go:
Aha. This is starting to make much more sense. The second output is is a great help. Thanks so much for the response.