A comprehensive guide to reflectance - the fraction of incident light reflected by a surface as a function of wavelength, fundamental to color measurement, spectrophotometry, and accurate color reproduction in digital imaging and color science applications.
Reflectance is the fraction of incident light that is reflected by a surface, typically expressed as a function of wavelength. It is a fundamental optical property that determines how materials appear under different lighting conditions and forms the basis for accurate color measurement, spectrophotometry, and color reproduction in digital imaging systems.
When light strikes a surface, it can be absorbed, transmitted, or reflected. Reflectance specifically measures the reflected portion and varies with wavelength, giving materials their characteristic colors. The spectral reflectance curve provides complete information about a material's optical properties.
// Reflectance analyzer implementation
class ReflectanceAnalyzer {
constructor() {
// Standard wavelength range for visible spectrum
this.wavelengthRange = {
start: 380,
end: 780,
interval: 10
};
// Standard illuminants
this.illuminants = {
'D65': this.generateDaylightSPD(6504),
'D50': this.generateDaylightSPD(5003),
'A': this.generatePlanckianSPD(2856)
};
// Material surface types
this.surfaceTypes = {
'matte': { specular: 0.02, diffuse: 0.98 },
'semigloss': { specular: 0.15, diffuse: 0.85 },
'gloss': { specular: 0.40, diffuse: 0.60 }
};
}
// Analyze spectral reflectance curve
analyzeSpectralReflectance(wavelengths, reflectance) {
if (wavelengths.length !== reflectance.length) {
throw new Error('Wavelength and reflectance arrays must have the same length');
}
const minReflectance = Math.min(...reflectance);
const maxReflectance = Math.max(...reflectance);
const avgReflectance = reflectance.reduce((sum, r) => sum + r, 0) / reflectance.length;
const peaks = this.findPeaks(wavelengths, reflectance);
const valleys = this.findValleys(wavelengths, reflectance);
const dominantWavelength = this.findDominantWavelength(wavelengths, reflectance);
return {
statistics: {
minimum: minReflectance,
maximum: maxReflectance,
average: avgReflectance,
range: maxReflectance - minReflectance,
contrast: (maxReflectance - minReflectance) / maxReflectance
},
spectralFeatures: {
peaks: peaks,
valleys: valleys,
dominantWavelength: dominantWavelength
},
colorAnalysis: this.analyzeColorRegions(wavelengths, reflectance),
materialType: this.classifyMaterial(reflectance)
};
}
// Calculate tristimulus values from reflectance
reflectanceToTristimulus(wavelengths, reflectance, illuminant = 'D65') {
const illuminantSPD = this.illuminants[illuminant];
if (!illuminantSPD) {
throw new Error(`Unknown illuminant: ${illuminant}`);
}
let X = 0, Y = 0, Z = 0;
let normalizationFactor = 0;
for (let i = 0; i < wavelengths.length; i++) {
const wl = wavelengths[i];
const rho = reflectance[i];
const S = this.getIlluminantPower(illuminantSPD, wl);
const xBar = this.getColorMatchingValue('x', wl);
const yBar = this.getColorMatchingValue('y', wl);
const zBar = this.getColorMatchingValue('z', wl);
const deltaWl = 10; // Standard interval
X += rho * S * xBar * deltaWl;
Y += rho * S * yBar * deltaWl;
Z += rho * S * zBar * deltaWl;
normalizationFactor += S * yBar * deltaWl;
}
const k = 100 / normalizationFactor;
return {
X: X * k,
Y: Y * k,
Z: Z * k,
illuminant: illuminant,
method: 'Spectral integration'
};
}
// Compare reflectance curves
compareReflectanceCurves(curve1, curve2) {
if (curve1.wavelengths.length !== curve2.wavelengths.length) {
throw new Error('Curves must have same wavelength range');
}
const differences = [];
let sumSquaredDiff = 0;
for (let i = 0; i < curve1.reflectance.length; i++) {
const diff = Math.abs(curve1.reflectance[i] - curve2.reflectance[i]);
differences.push(diff);
sumSquaredDiff += diff * diff;
}
const rmsDifference = Math.sqrt(sumSquaredDiff / differences.length);
const avgDifference = differences.reduce((sum, d) => sum + d, 0) / differences.length;
const xyz1 = this.reflectanceToTristimulus(curve1.wavelengths, curve1.reflectance);
const xyz2 = this.reflectanceToTristimulus(curve2.wavelengths, curve2.reflectance);
const deltaE = this.calculateDeltaE(xyz1, xyz2);
return {
spectralDifferences: {
rms: rmsDifference,
average: avgDifference,
maximum: Math.max(...differences)
},
colorDifference: { deltaE, xyz1, xyz2 },
similarity: {
spectral: rmsDifference < 0.02 ? 'Excellent' : rmsDifference < 0.05 ? 'Good' : 'Fair',
color: deltaE < 1 ? 'Excellent' : deltaE < 2 ? 'Good' : 'Fair'
}
};
}
// Metamerism analysis
analyzeMetamerism(curve1, curve2, illuminants = ['D65', 'A', 'F2']) {
const results = [];
illuminants.forEach(illuminant => {
const xyz1 = this.reflectanceToTristimulus(curve1.wavelengths, curve1.reflectance, illuminant);
const xyz2 = this.reflectanceToTristimulus(curve2.wavelengths, curve2.reflectance, illuminant);
const deltaE = this.calculateDeltaE(xyz1, xyz2);
results.push({
illuminant: illuminant,
deltaE: deltaE,
match: deltaE < 1 ? 'Excellent' : deltaE < 2 ? 'Good' : deltaE < 5 ? 'Acceptable' : 'Poor'
});
});
const deltaEs = results.map(r => r.deltaE);
const metamerismIndex = Math.max(...deltaEs) - Math.min(...deltaEs);
return {
metamerismIndex: metamerismIndex,
illuminantResults: results,
rating: metamerismIndex < 1 ? 'Excellent' : metamerismIndex < 2 ? 'Good' : 'Acceptable'
};
}
// Helper methods
findPeaks(wavelengths, reflectance) {
const peaks = [];
for (let i = 1; i < reflectance.length - 1; i++) {
if (reflectance[i] > reflectance[i-1] && reflectance[i] > reflectance[i+1]) {
peaks.push({ wavelength: wavelengths[i], reflectance: reflectance[i] });
}
}
return peaks;
}
findValleys(wavelengths, reflectance) {
const valleys = [];
for (let i = 1; i < reflectance.length - 1; i++) {
if (reflectance[i] < reflectance[i-1] && reflectance[i] < reflectance[i+1]) {
valleys.push({ wavelength: wavelengths[i], reflectance: reflectance[i] });
}
}
return valleys;
}
findDominantWavelength(wavelengths, reflectance) {
const maxReflectance = Math.max(...reflectance);
const maxIndex = reflectance.indexOf(maxReflectance);
return {
wavelength: wavelengths[maxIndex],
reflectance: maxReflectance,
colorRegion: this.getColorRegion(wavelengths[maxIndex])
};
}
analyzeColorRegions(wavelengths, reflectance) {
const regions = {
blue: { range: [450, 495], reflectance: 0 },
green: { range: [495, 570], reflectance: 0 },
yellow: { range: [570, 590], reflectance: 0 },
red: { range: [620, 780], reflectance: 0 }
};
Object.keys(regions).forEach(region => {
const [start, end] = regions[region].range;
let sum = 0, count = 0;
for (let i = 0; i < wavelengths.length; i++) {
if (wavelengths[i] >= start && wavelengths[i] <= end) {
sum += reflectance[i];
count++;
}
}
regions[region].reflectance = count > 0 ? sum / count : 0;
});
return regions;
}
classifyMaterial(reflectance) {
const avgReflectance = reflectance.reduce((sum, r) => sum + r, 0) / reflectance.length;
const contrast = (Math.max(...reflectance) - Math.min(...reflectance)) / Math.max(...reflectance);
let classification = 'Unknown';
if (avgReflectance > 0.8) {
classification = 'White/Light colored';
} else if (avgReflectance < 0.1) {
classification = 'Black/Dark colored';
} else if (contrast > 0.5) {
classification = 'Selective/Colored';
} else {
classification = 'Neutral/Gray';
}
return {
classification: classification,
averageReflectance: avgReflectance,
contrast: contrast
};
}
getColorRegion(wavelength) {
if (wavelength < 450) return 'Violet';
if (wavelength < 495) return 'Blue';
if (wavelength < 570) return 'Green';
if (wavelength < 590) return 'Yellow';
if (wavelength < 620) return 'Orange';
return 'Red';
}
calculateDeltaE(xyz1, xyz2) {
const lab1 = this.xyzToLab(xyz1.X, xyz1.Y, xyz1.Z);
const lab2 = this.xyzToLab(xyz2.X, xyz2.Y, xyz2.Z);
const deltaL = lab1.L - lab2.L;
const deltaA = lab1.a - lab2.a;
const deltaB = lab1.b - lab2.b;
return Math.sqrt(deltaL * deltaL + deltaA * deltaA + deltaB * deltaB);
}
xyzToLab(X, Y, Z) {
const wp = { X: 95.047, Y: 100.000, Z: 108.883 }; // D65
const xn = X / wp.X;
const yn = Y / wp.Y;
const zn = Z / wp.Z;
const fx = this.labFunction(xn);
const fy = this.labFunction(yn);
const fz = this.labFunction(zn);
return {
L: Math.max(0, Math.min(100, 116 * fy - 16)),
a: Math.max(-128, Math.min(127, 500 * (fx - fy))),
b: Math.max(-128, Math.min(127, 200 * (fy - fz)))
};
}
labFunction(t) {
const delta = 6 / 29;
return t > Math.pow(delta, 3) ? Math.pow(t, 1/3) : (t / (3 * delta * delta)) + (4 / 29);
}
// Simplified SPD generation methods
generateDaylightSPD(cct) {
const spd = {};
for (let wl = 380; wl <= 780; wl += 10) {
spd[wl] = 100 * Math.exp(-Math.pow((wl - 550) / 100, 2));
}
return spd;
}
generatePlanckianSPD(cct) {
const spd = {};
for (let wl = 380; wl <= 780; wl += 10) {
const wavelengthM = wl * 1e-9;
const c1 = 3.74183e-16;
const c2 = 1.4388e-2;
spd[wl] = (c1 / Math.pow(wavelengthM, 5)) / (Math.exp(c2 / (wavelengthM * cct)) - 1);
}
return spd;
}
getIlluminantPower(spd, wavelength) {
return spd[wavelength] || 0;
}
getColorMatchingValue(component, wavelength) {
// Simplified color matching functions
if (component === 'x') {
return wavelength < 500 ? Math.exp(-Math.pow((wavelength - 440) / 50, 2)) :
wavelength < 650 ? Math.exp(-Math.pow((wavelength - 580) / 80, 2)) : 0;
} else if (component === 'y') {
return Math.exp(-Math.pow((wavelength - 555) / 60, 2));
} else if (component === 'z') {
return wavelength < 500 ? Math.exp(-Math.pow((wavelength - 450) / 40, 2)) : 0;
}
return 0;
}
}The most complete description of a material's optical properties, showing how reflectance varies with wavelength across the visible spectrum. This data enables accurate color calculations under any illuminant.
The component of reflection that is scattered uniformly in all directions, giving materials their characteristic color appearance. Measured using integrating sphere or 45°/0° geometry.
The mirror-like reflection component that preserves the angle of incidence. Important for glossy surfaces and affects the overall appearance and color saturation.
Illuminates the sample at 45° and views at 0° (perpendicular), excluding specular reflection to measure only the diffuse component. Standard for color measurement applications.
Uses an integrating sphere for diffuse illumination and views at 8° from perpendicular. Includes both diffuse and specular components for total appearance measurement.
Reflectance measurements of color patches enable accurate ICC color profile creation for displays, printers, and cameras, ensuring consistent color reproduction.
Understanding material reflectance properties helps optimize lighting conditions and camera settings for accurate color capture in digital imaging systems.
Reflectance data provides the foundation for advanced color correction algorithms that account for material properties and lighting conditions.
Explore these comprehensive pillar articles related to Reflectance
A comprehensive guide to color theory, its fundamental principles, and practical applications in digital design and web development.
Comprehensive guide to complementary colors - opposing hues on the color wheel that create maximum visual contrast, dynamic tension, and powerful design impact through scientific color relationships and perceptual phenomena.
Comprehensive guide to analogous color schemes - adjacent hues on the color wheel that create natural harmony, visual cohesion, and sophisticated design solutions through subtle color relationships and graduated transitions.
Comprehensive guide to triadic color schemes - three colors evenly spaced around the color wheel that create balanced, vibrant, and dynamic visual compositions with mathematical precision and artistic appeal.
Discover more about Reflectance and related color theory concepts
A comprehensive guide to color theory, its fundamental principles, and practical applications in digital design and web development.
Comprehensive guide to analogous color schemes - adjacent hues on the color wheel that create natural harmony, visual cohesion, and sophisticated design solutions through subtle color relationships and graduated transitions.
Comprehensive guide to complementary colors - opposing hues on the color wheel that create maximum visual contrast, dynamic tension, and powerful design impact through scientific color relationships and perceptual phenomena.
A comprehensive guide to monochromatic color schemes - sophisticated single-hue harmonies that create unified visual experiences through systematic variations in saturation, lightness, and tonal relationships, essential for elegant design compositions, brand consistency, and advanced color theory applications requiring cohesive aesthetic unity.
A comprehensive guide to split-complementary color schemes - sophisticated three-color harmonies that combine a base color with two colors adjacent to its complement, creating balanced visual contrast with reduced tension compared to direct complementary pairs, essential for refined design compositions, brand identity systems, and advanced color theory applications.
A comprehensive guide to tetradic color schemes - sophisticated four-color harmonies that use two complementary pairs arranged in rectangular or square formations on the color wheel, providing maximum color variety while maintaining structured relationships essential for dynamic design compositions, brand systems, and advanced color theory applications.
Discover more color terminology and concepts in our comprehensive glossary.
Browse Full Glossary