Overview
The Color Binary serializer interleaves binary bits across RGB color channels, encoding 9 bits (8 data bits + 1 dummy bit) into 3 color-coded blocks. This creates visually distinctive patterns and provides an alternative to monochrome binary encoding.Class: ColorBinary
Namespace: GlobalImplements:
IDMXSerializer
Configuration Constants
Size in pixels of each bit block (4×4 pixels)
Number of bit blocks per column
How It Works
Color Interleaving
Each DMX channel is split into 8 bits, then a 9th dummy bit (always 0) is added. These 9 bits are grouped into triplets and assigned to RGB channels:Visual Pattern
Unlike monochrome binary encoding, Color Binary produces colorful blocks:| Bit Pattern | Color | RGB |
|---|---|---|
| 000 | Black | (0,0,0) |
| 001 | Blue | (0,0,255) |
| 010 | Green | (0,255,0) |
| 011 | Cyan | (0,255,255) |
| 100 | Red | (255,0,0) |
| 101 | Magenta | (255,0,255) |
| 110 | Yellow | (255,255,0) |
| 111 | White | (255,255,255) |
Block Layout
Each channel uses 3 color blocks instead of 8 monochrome blocks:Methods
SerializeChannel
Encodes a DMX channel value as 3 color-interleaved blocks.The pixel array to write the encoded blocks to
The DMX channel value (0-255) to encode
The DMX channel number
Width of the output texture
Height of the output texture
- Converts channel value to BitArray (8 bits)
- Adds a 9th bit (always false/0) for alignment
- Groups bits into triplets (3 bits per block)
- For each triplet:
- Calculates block position:
(channel * 3) + blockIndex - Creates color with R=bit0, G=bit1, B=bit2
- Writes 4×4 color block to pixel array
- Calculates block position:
- Skips blocks that exceed texture bounds
DeserializeChannel
Decoding is not implemented.Usage Example
Channel Capacity
Color Binary uses 3 blocks per channel (vs 8 for standard binary):Capacity by Resolution
| Resolution | Channels | vs Binary | vs VRSL |
|---|---|---|---|
| 128×128 | 272 | -34% | +61% |
| 256×256 | 1,088 | +161% | +544% |
| 512×512 | 4,352 | +161% | +544% |
| 1024×1024 | 17,408 | +161% | +544% |
Color Binary provides 2.6× the capacity of standard Binary serializer due to using only 3 blocks per channel.
Advantages
High Density
3 blocks per channel (vs 8 for binary) = 2.6× more efficient
Visual Debugging
Color patterns make data flow easily visible
Channel Separation
RGB separation may improve compression in some codecs
Distinctive
Colorful blocks are immediately recognizable
Limitations
- No Decoder: Cannot receive and decode color binary data
- Color Compression: YUV video compression may corrupt RGB channel separation
- Chroma Subsampling: 4:2:0 or 4:2:2 will destroy color accuracy
- Dummy Bit: 9th bit wastes ~11% of bit capacity
Best Practices
1. Video Settings
Color Binary requires RGB-native video pipeline:2. Visualization
Create debug visualization to verify encoding:3. Testing
Test with values that produce known color patterns:Implementing Deserialization
To add decode support, implement the following:Comparison with Other Serializers
| Feature | Color Binary | Binary | VRSL |
|---|---|---|---|
| Blocks per channel | 3 | 8 | 1 |
| Block size | 4×4 | 4×4 | 16×16 |
| Color encoding | RGB | Mono | Mono/RGB |
| Channels (256×256) | 1,088 | 416 | 169 |
| Decoding | No | Yes | Yes |
| Video format | RGB only | Any | Any |
| Visual appearance | Colorful | B&W | Gray |
Use Cases
When to Use Color Binary
✅ Good for:- Visual debugging and monitoring
- High-density one-way transmission
- RGB-native video pipelines
- Artistic/visual effects applications
- Bidirectional communication (no decoder)
- YUV video formats
- Compressed video streams
- Production systems requiring reliability
Performance
- Encoding: ~0.018ms per channel
- Memory: Minimal (BitArray + List overhead)
- Block writes: 3 per channel vs 8 for binary
Future Enhancements
Color Binary is functional but incomplete. Contributions welcome!
- Implement
DeserializeChannelmethod - Remove dummy 9th bit to use all 8 bits efficiently
- Add color threshold calibration
- Test with various video codecs and compression levels
- Implement error detection using color parity
Visual Examples
Common DMX values and their color patterns:The colorful patterns make Color Binary ideal for visual debugging and demonstrations, even if full decoding is not implemented.