Raspberry Pi + neopixel:如果降低RGB LED的亮度,是否表示无法渲染某些颜色?

Referring to the python library neopixel (rpi_ws281x), to control WS2812B RGB LED strips, does trimming the brightness by scaling the byte for each sub-LED in a pixel from 255 to 127 limits us from rendering certain colors?

根据该库,出于调光目的,执行以下代码:

def setBrightness(self, brightness):
        """Scale each LED in the buffer by the provided brightness.  A brightness
        of 0 is the darkest and 255 is the brightest.
        """
        ws.ws2811_channel_t_brightness_set(self._channel, brightness)

但是,如果我想以50%的亮度渲染RGB(255,187,120)的颜色:在我看来,数据帧位被裁剪为每个像素最大(127,127,127)-根据代码上面,哪个颜色不能显示?

我对吗?

谁能解释该库中的亮度控制/调光功能如何工作? 它不应该降低PWM占空比以降低亮度(功率)吗?

请解释。谢谢。

评论
你美
你美

The color values are not clipped, but multiplied by the brightness factor. So 255 turns into 127, 127 into 63.

The color (255, 187, 120) would then become (127, 93, 60).

这意味着您将平均失去所有明亮的颜色“变体”。

A CCT of 3200K, which would be defined as (255, 187, 120), would still be 3200K at (127, 93, 60), since the relation between the colors stays the same. If you had LEDs with a higher dynamic range, 3200K could be defined as (1023, 375, 239).

But one thing to notice is that brightness is not a linear function in these LEDs. Usually the brightness jump from 0 to 16 is much more noticeable than the one from 111 to 127, so yes, in that sense you will lose colors. You would have more accurate colors by putting a black textile over the LED which let's only through 50% of the light.

点赞
评论