Web application for converting spectral reflection data into accurate color representations using CIE 1931 color matching functions. This tool is designed for researchers, color scientists, designers, and anyone working with spectral data analysis.
- Spectral to Color Conversion: Transform wavelength-based reflection data (300-800nm) into precise color values
- CIE 1931 Standard: Uses scientifically accurate color matching functions for reliable results
- Multi-Angle Support: Process spectral data at different measurement angles (0°, 15°, 30°, 45°, 60°, 75°)
- Multiple Illuminants: Support for various standard illuminants (D65, A, C, etc.)
- Observer Options: 2° and 10° standard observer support
- Gamma Correction: Optional gamma correction for display optimization
- Data Validation: Automatic validation of spectral data format and ranges
The application implements the CIE 1931 color matching standard to convert spectral reflection data into XYZ color space, then transforms it to RGB for display. The process involves:
- Data Parsing: Validates and processes spectral reflection data
- Color Matching: Applies CIE 1931 color matching functions
- Illuminant Correction: Adjusts for selected illuminant characteristics
- Color Space Conversion: Transforms XYZ to RGB color space
- Display Optimization: Optional gamma correction for accurate screen representation
The application accepts spectral data in tab-separated format:
wavelength(nm) angle(degrees) reflectance(0-1)
300 0.00 0.63596
310 0.00 0.55401
...
Simulated spectra can be created with this online tool by KLA: https://www.kla.com/products/instruments/reflectance-calculator?wmin=380&wmax=780&wstep=5&angle=0&pol=mixed&units=nm&mat%5B%5D=Air&d%5B%5D=0&mat%5B%5D=Al2O3&d%5B%5D=100&mat%5B%5D=Si&d%5B%5D=0&sptype=r
- React 18: Modern React with hooks and functional components
- TypeScript: Type-safe development and better code reliability
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework for responsive design
- shadcn/ui: High-quality, accessible UI components
- Node.js (v16 or higher)
- npm or yarn package manager
Docker images are available for x64 and armv8, it can be run with docker-compose
services:
spectral:
ports:
- 80:80
image: ghcr.io/asamarco/spectral:latest
container_name: spectral
restart: unless-stoppedIn alternative:
- Clone the repository:
git clone https://github.com/asamarco/spectral/
cd spectral-color-converter- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:8080
npm run buildThe built application will be available in the dist directory.
Input reflectance values for wavelengths from 300-800nm at specific angles to see the resulting color.
Compare how the same material appears at different viewing angles by inputting data for multiple angle measurements.
Use different illuminants to see how colors appear under various lighting conditions.
This tool implements industry-standard color science practices:
- CIE 1931 2° Standard Observer color matching functions
- Standard illuminant data (D65, A, C, etc.)
- Proper normalization and scaling
- Scientifically accurate color space transformations
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
This project is open source and available under the MIT License.
Built with precision for color science professionals and enthusiasts.