Skip to content

Add an option to apply 3D LUT with video filters #4284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
waydabber opened this issue Apr 20, 2025 · 1 comment
Open

Add an option to apply 3D LUT with video filters #4284

waydabber opened this issue Apr 20, 2025 · 1 comment
Labels
enhancement New feature or request PIP/Stream PIP or full screen streaming

Comments

@waydabber
Copy link
Owner

Orignal request:


Dear BetterDisplay folks,

I absolutely love your app and use it daily on my Mac Studio / Studio Display @ work and on my MacBook Pro @ home. Thank you so much for the awesome tool!

I am writing to ask if you have given any thought to implementing a feature that would allow the application of a 3D LUT to a given display? I am a colorist by day, working primarily in advertising - I color grade television commercials. Display calibration has always been a huge pain in the ass, much of which comes directly from the cost and complexity often involved in finding a way to apply the image adjustments necessary to "calibrate" any given display. Measuring a display and even generating a 3D LUT to correct that display to a given reference is usually the easy part, relatively speaking.

If BetterDisplay gave me the ability to simply load a .cube format 3D LUT file and apply it seamlessly to any display connected to my Mac, that would literally be the best thing since sliced bread.

I've attached two example calibration LUT's for you to look at. I originally created these by measuring a 16" M1 MacBook Pro display with either ColourSpace or Calman. Normally these would be used by loading them into the system settings of DaVinci Resolve while also disabling ColorSync/MacOS color management (also in the Resolve settings).

With BetterDisplay, it would be a bit more complex as I'm assuming it would not be possible to disable ColorSync system-wide, nor would I want to. So it would be left up to me, the user, to know how to properly measure the display, how to generate valid calibration LUT's from that data, and also to know which LUT to enable in BetterDisplay and when. But having such an ability at all would be fantastic, as I am not presently aware of any other existing software that allows for system-wide application of a 3D LUT in macos. Such a tool does exist for Windows called "dwm_lut". You can find that here- https://github.com/lauralex/dwm_lut

If there's any interest in adding this, please let me know if there's anything else I could provide that might be helpful, or if there's anything else I might be able to shed light on. I would be more than happy to answer any questions, etc. I am fairly experienced with display calibration, have a thorough "working" understanding of the process and how things need to be adapted for accurate use within MacOS/ColorSync (as a colorist/end-user, not as a color scientist or engineer!) and have all the current industry standard tools here at my disposal.

thanks so much again!
-adam

sRGB_to_radambe16XDR.cube.zip
REC709_to_radambe16XDR.cube.zip

@waydabber waydabber added enhancement New feature or request PIP/Stream PIP or full screen streaming labels Apr 20, 2025
@waydabber
Copy link
Owner Author

waydabber commented Apr 20, 2025

Hi Adam,

thanks for the kind words.

macOS can easily import and apply 1 dimensional LUT tables (called gamma table or color table) for each color channels. A 3D LUT table however requires more complex processing, as this can convert any color (defined by an RGB value, so all three channels) to any other color (also defined by an RGB value). Since a full 3D LUT channel (even at 8 bit, not talking about 10 bit) would have an enormous size, 3D LUT tables usually contain just a few samples (yours is 33x33x33) and the system must interpolate based on that.

Sadly macOS does not have any native way to apply a 3D LUT table on the framebuffer directly. So the only way to do this is to capture each frame, apply the LUT table and then output the processed frame. This has some latency (at least 3 frames) and depending on display size and the GPU power involved might even lower the output fps, but for most applications (except for gaming) this could still be fine. If you download the latest app version (v3.5.4), go to Stream Display and select "Self Stream + Video Filter" and then scroll down, enable "Photo Effect" and choose one, like "Chrome", "Instant" etc, you’ll see how a 3D LUT based transformation on the fly looks like (see attached screenshot where to set it). You can also apply this to only a section of the screen by using Tools/Video Filter Window.

The same way as these predefined/popular "Photo Effect" 3D LUT transformation based filters are applied, an option could be added to import a custom LUT table (I assume the cube format contains 32-bit floating point values in BGR order, right?), define the associated color space (as it should describe the dimensions on which the LUT table should be interpreted and whether it is linear or not) and apply that to the image.

Best,
Steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PIP/Stream PIP or full screen streaming
Projects
None yet
Development

No branches or pull requests

1 participant