Skip to content

NeoPixelBrightnessBus being deprecated #3087

Closed

Description

@softhack007

Is your feature request related to a problem? Please describe.
I just saw the announcement from makuna

Describe the solution you'd like
We are currently using NeoPixelBrightnessBus objects in bus_manager.h + bus_wrapper.h.

It seems that there is a replacement with similar functionality, however considering that we also have challenges related to gamma correction LUT and "non-natural dimming" (like #2767), destructive brightness reduction, and color values < 28 being mapped to 0 due to 8bit gamma LUT (several discussions on discord) , and we want to support higher bitdepht at least for PWM (#2868),...

Well it might be a good time to plan for a redesign of bus_manager.h, and see if we can replace NeoPixelBrightnessBus with something more appropriate.

Thank you for your ideas for making WLED better!

Activity

  1. blazoncek commented on Feb 10, 2023

    @blazoncek
    Contributor

    It should not be that difficult, though tedious, as entire WLED interacts with bus manager and not bus wrapper.
    Btw bus_manager is an abstraction layer providing API (actually replicating NPBB from bus_wrapper).

  2. added a commit that references this issue on Feb 12, 2023
    9434d17
  3. blazoncek commented on Feb 13, 2023

    @blazoncek
    Contributor

    @softhack007 will you have time to test the above commit?

  4. softhack007 commented on Feb 13, 2023

    @softhack007
    MemberAuthor

    @softhack007 will you have time to test the above commit?

    Not this week, sorry. I'm away from home until 20th.
    But I'll surely take a look and test next week.

  5. Aircoookie commented on Feb 14, 2023

    @Aircoookie
    Member

    Color recovery (although lossy) is quite trivial: recovered = (original*256) / (brightness+1). I would therefore propose we use the standard NeoPixelBus instead of NeoPixelBusLg and handle the brightness scaling in bus manager. This also gives greater control for >8 bit busses. As for the new gamma correction capability (which is cool to have in the library now!), it would likely not make sense to delegate it to NPB, as we still need it within WLED for e.g. analog busses and for functionality like having correction enabled for FX but not for live data.

    @blazoncek I will do ESP8266 testing of #3091 on Wednesday, will test adding brightness scaling to get/setPixelColor :)

  6. blazoncek commented on Feb 14, 2023

    @blazoncek
    Contributor

    NPBLg will return unmodified (original) pixel value from SetPixelColor(), there should be no need to recover old value from it.
    At least that was my impression after a glimpse of the NPBLg code.

    There are some clever tricks in NPBLg for 16bit LEDs.

  7. Aircoookie commented on Feb 14, 2023

    @Aircoookie
    Member

    As far as I understand, it returns the original (as in, already scaled) value as written to the LED. So if you set 255,128,0 at 50% bri it would just return 127,64,0 rather than attempting to restore the color: https://github.com/Makuna/NeoPixelBus/blob/master/src/NeoPixelBusLg.h#L92-L92

    Non-lossy reconstruction is not even possible without an extra buffer, but I will give you the benefit of the doubt and first test the PR as is.

  8. blazoncek commented on Feb 14, 2023

    @blazoncek
    Contributor

    Looks like my brief read-through was not accurate enough.
    And BTW, I did not touch post-processing in bus_wrapper. I merely replaced NeoPixelBrightnessBus with NeoPixelBusLg. Nothing more.

  9. added a commit that references this issue on Jan 31, 2024
    e001165
  10. added a commit that references this issue on Aug 18, 2026
    1658d9e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions