Brightness mapping?

I just built a string into an art piece (it’s not yet hooked up to a pixelblaze, eager for it to arrive in the mail, just hooked up a cheap controller (the inline fixed pattern ones) to test out the art build, and noticed something I’d like to compensate for…

Some pixels are “hotter” than others, the diffuser is closer, or it’s illuminating a small space, compared to others which are noticably dimmer due to larger/distant diffuser… adjusting the brightness of the string as a whole doesn’t help, since really I want to turn down the brighter ones and turn up the dimmer ones.

Is a brightness map doable? Maybe on the same 0…1 scale, where everything is .5 by default? Turning up a pixel to .75 or down to .25, etc…

Or is there a better way of handling this in software?

Sure! I might be tempted to do something like this in my pattern code:

vScale = array(pixelCount)
// Initialize everything
for (i = 0; i < pixelCount; i++) vScale[i] = .25

// Adjust some individual pixels
vScale[1] = 0.1
vScale[4] = 0.9

export function render(index) {
  w = wave(index / pixelCount + time(.1)) // Or whatever your pattern code is
  v = w * vScale[index] // This is it! Scale individual pixels. 
  hsv(1 - .4 * w, 1, v * v)
}

In addition to @jeff’s idea, you can hack the pixel map if you don’t yet have one or have a free dimension. You could use the z height to adjust relative brightness on an otherwise 2D piece.

1 Like

Sadly the piece is 3d, so no free dimension here.
Unless you’ve added a 4th dimension, oh great wizard.

3 Likes