Add CCT ramp mode for D4K-3ch with colorimetric accuracy#147
Open
GlassOnTin wants to merge 2 commits intoToyKeeper:trunkfrom
Open
Add CCT ramp mode for D4K-3ch with colorimetric accuracy#147GlassOnTin wants to merge 2 commits intoToyKeeper:trunkfrom
GlassOnTin wants to merge 2 commits intoToyKeeper:trunkfrom
Conversation
Adds tooling and documentation for achieving accurate color reproduction on multi-channel LED flashlights like the D4K-3ch. tools/led_colorimetry.py: - Compute optimal RGB mixing coefficients from LED spectral data - Calculate Planckian locus (blackbody) color coordinates - Generate lookup tables for CCT-to-RGB conversion - Support for arbitrary LED combinations and color temperatures docs/color-science.md: - Color science fundamentals (CIE 1931, chromaticity) - LED spectral characteristics and mixing theory - Derivation of PWM scaling factors for balanced color - Planckian locus mathematics for CCT mode - Visual diagrams: chromaticity, LED SPDs, color mixing tools/generate_color_figures.py: - Generates all documentation figures from source data - Chromaticity diagrams, spectral plots, mixing visualizations
Adds a correlated color temperature (CCT) mode that smoothly transitions along the Planckian locus (blackbody curve) from warm to cool white. New channel mode CM_CCT: - Default range: 2700K (warm incandescent) to 6500K (D65 daylight) - Extended range option: 1800K to 10000K (define CCT_TABLE_EXTENDED) - 3H gesture adjusts color temperature - Lookup table interpolation for smooth transitions Implementation: - 16-entry RGB lookup table computed from CIE 1931 colorimetry - Values pre-scaled for RGBG LED configuration (dual green LEDs) - Bilinear interpolation between table entries - Gradual tick support for smooth ramping The LUT was generated using tools/led_colorimetry.py which computes optimal RGB values to match points along the Planckian locus, accounting for the specific LED spectral characteristics of the D4K-3ch. Also enables all 9 channel modes by default: - CM_MAIN2, CM_LED3, CM_LED4, CM_ALL (single/combined channels) - CM_BLEND34A, CM_BLEND34B (manual R+B, R+G blends) - CM_HSV (hue wheel), CM_AUTO3 (cyan auto-blend), CM_CCT (new)
Author
|
Video with the camera white balance locked at 6500K. Then varying the torch colour temperature: VID_20251212_152253_431.mp4 |
Author
VID_20251212_152834_152.mp4 |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a correlated color temperature (CCT) channel mode for the Emisar D4K-3ch that produces accurate white tones along the Planckian locus (blackbody curve).
Channel Modes
The D4K-3ch now has 9 channel modes enabled by default:
Implementation Details
CCT_TABLE_EXTENDEDdefineTooling
tools/led_colorimetry.pycomputes optimal RGB values from:Test Plan