"Fairy" lights in a matrix on a clear vinyl sheet

Yes, the secret is to assign those pixels values where they won’t turn on. You have a few options:

  1. pick a extreme value, instead of the real value, so that you can identify which pixels to keep off. Since mapping renormalizes all values, you’ll want to assign some values that you can identify without breaking the rest of your map. So if your map values run from 0 to 30 (for example), assigning a bunch to 100 will skew all of your map badly on renormalizing, but assigning 31 to them all will set that as the extreme edge (close to 1 in the renormalized map.). Then for each pixel, in render(), if the value is “too high” (close to 1), do nothing (or send all zeros), and they won’t light up.

  2. do it outside the map. While this requires more code per pattern, it’s super flexible, and let’s you do multiple things like one pattern will be a circle and another will be a star, etc.

Just make a list of what pixel index numbers to keep off… Set those into an array at the start of your pattern, and then, in render(), if the index value is in that array, instead of whatever your pattern is supposed to do, just do nothing (send zeros).

If you really want to limit ALL patterns (so even unmodified patterns only do a star shape, for example), there is no good way to do it. At some point, you’ll need to modify code I think. Given that, option 2 is way way more flexible (since you can adjust the “mask”, and even make multiple masks if you wish) so I’d do it that way, rather than in the map.

Maybe @wizard or @jeff or @zranger1 has a better idea, but I can’t think of one.

Actually by mentioning @zranger1 , I did think of a 3rd option, which is to use the shader math approach, and calculate the SDF (signed distance field) “mask” on top of the pattern, and if outside the desired shape, do nothing. That’s actually how we do a lot of fun stuff anyway.
Sorry I didn’t flesh this out more but it’s described elsewhere on this forum, also see GitHub - zranger1/SDF-LED: Tools for using signed distance fields and other shader-influenced rendering techniques with 2D/3D addressable LED controllers.