π spectro-rs
spectro-rs is a high-performance Rust driver for X-Rite ColorMunki (Original/Design) spectrometers. It provides a modern, safe, and easy-to-use cross-platform interface for color measurement, display calibration, and light analysis.
β¨ Features
- π Cross-platform: Supports Windows, macOS, and Linux.
- π Multi-mode Measurement:
- Reflective: Measure paper, prints, and materials. Includes automated dark/white calibration.
- Emissive: Optimized
emtxmatrix for accurate display/monitor measurement. - Ambient: Measure light source spectral power distribution (SPD).
- π§ͺ Colorimetry Engine:
- Real-time calculation of CIE XYZ, Chromaticity (x, y), and CIE Lab*.
- Estimated CCT (Correlated Color Temperature) and Spectral Centroid.
- π¨ Spectral Visualization: Live ANSI color spectrum chart in your terminal.
- π Internationalization: Built-in English and Chinese (Simplified) support.
π οΈ Getting Started
1. Prerequisites
- Rust toolchain.
- Windows: If the device is not detected, use Zadig to replace the driver with
WinUSB. - Linux: Ensure you have correct
udevrules for USB access.
2. Run
π Operational Guide
π Calibration
Always run Restart Calibration before critical measurements:
- Turn the dial to the White Dot (Position 2).
- The program will perform a Dark Frame (Lamp OFF) followed by White Tile (Lamp ON) calibration.
π± Monitor Mode (Emissive)
- Turn the dial to Measurement (Position 4).
- Place the device firmly against the screen.
- Select Measure Emissive (Monitor).
π‘ Light Source (Ambient)
- Turn the dial to Ambient (Position 1) (with the diffuser罩).
- Point toward the light source.
- Select Measure Ambient (Light Source).
ποΈ Technical Background
Inspired by ArgyllCMS:
- EEPROM Logic: Replicates memory mapping for linearization polynomials and factory matrices.
- Spectral Mapping: Transposes 128 sensor readings to 36 standard 10nm bands (380nm-730nm).
π οΈ Development & CI/CD
This project follows modern DevOps practices to ensure code quality:
βοΈ CI/CD (GitHub Actions)
- CI: Every push to
main(excluding documentation changes) triggers a suite of tests, formatting checks, and lints (clippy). - CD: Pushing a tag (
v*) automatically publishes the crate to crates.io.
β Pre-commit Hooks
To maintain high code quality locally, we use pre-commit. It ensures all code is formatted and passes lints before you can commit.
- Install pre-commit.
- Run
pre-commit installin the project root.
βοΈ License
Licensed under GNU General Public License v3.0.
π€ Contributing
Contributions are welcome! Please open an issue for bugs or feature requests (e.g., support for i1Display Pro).