Cadmium red and yellow oil paint mixed with a knife on linen.

How Bloom mixes colors

Bloom's oil mixer uses a Metal port of the reflectance-spectrum mixing library Spectral.js1. It reconstructs spectra from each paint's catalog sRGB display color; it does not use measured pigment curves on the canvas.

Four ways to mix the same colors

Each bar uses the same endpoint colors; only the interpolation method changes. The midpoint represents a 50 / 50 input blend. For yellow and blue, the spectral mixer produces a brighter green midpoint.

The canvas uses Bloom's Metal port to evaluate the 38-band single-constant KM model, not the visualization's Bézier approximation. This is not a complete physical paint simulation. The JavaScript and Metal implementations use the same underlying approach. The final row shows an experimental Bézier fit; the canvas does not use it.

Cadmium Red + Cadmium Yellow Pale

sRGB interpolation
A straight interpolation of the same red and yellow sRGB values, shown for comparison with Bloom's spectral result.
Upstream JavaScript
Upstream JavaScript 38-band KM gradient from Cadmium Red to Cadmium Yellow Pale, using reconstructed spectra.
Bloom's Metal port (canvas mixer)
Bloom's Metal port: a 38-band KM gradient from Cadmium Red through orange to Cadmium Yellow Pale.
Bézier fit (experimental)
Experimental visualization-only cubic Bézier approximation from Cadmium Red to Cadmium Yellow Pale.

Red50 / 50Yellow

Cadmium Yellow Pale + Cerulean Blue

sRGB interpolation
A straight interpolation of the same yellow and blue sRGB values, with a more muted middle than Bloom's spectral result.
Upstream JavaScript
Upstream JavaScript 38-band KM gradient from Cadmium Yellow Pale to Cerulean Blue, using reconstructed spectra.
Bloom's Metal port (canvas mixer)
Bloom's Metal port: a 38-band KM gradient from Cadmium Yellow Pale through greens to Cerulean Blue.
Bézier fit (experimental)
Experimental visualization-only cubic Bézier approximation from Cadmium Yellow Pale to Cerulean Blue.

Yellow50 / 50Blue

For a fair comparison, each bar has 257 samples and uses the same unrounded catalog sRGB colors as the videos below. The sRGB, Metal-port, and Bézier-fit bars come from Bloom's native renderer; the upstream bars come from the JavaScript library. All keep the input endpoints and clip out-of-gamut channels instead of using perceptual gamut mapping. These are static SVGs, so no mixing library runs in this page.

  • sRGB interpolation: the simplest option. Blend each encoded red, green, and blue channel separately. There's no idea of paint here, and it's not linear-light blending either.
  • Upstream JavaScript: reconstructs a 38-band reflectance spectrum and mixes it with the single-constant Kubelka–Munk model. The comparison uses the pinned revision1, with tinting strengths of 1 and channel clipping.
  • Bloom's Metal port: this is the version behind the oil knife and some watercolor mixing paths. It uses 32-bit floats and a reflectance floor of 0.0001; the upstream JavaScript implementation uses 64-bit numbers and a smaller floor.
  • Bézier fit: this experimental visualization fits a cubic curve through spectral results at 1/3 and 2/3. It preserves those samples and the endpoints, but can differ between them. The canvas does not use this approximation.

The bars compare color paths; they do not establish which method best matches real paint or runs fastest. Both implementations use reconstructed spectra, not measured paint curves.

If you'd like the short version in math, a plain sRGB blend looks like this, applied to each encoded channel:

C(t)=(1−t)CA+tCB

The mixer combines modeled absorption-to-scattering ratios across wavelengths, producing a color path that differs from a straight sRGB blend. The videos below show the knife mixing each paint pair.

Native Bloom Sketches recording at four times speed. Circular Oil Flat brush strokes lay down Cadmium Red and Cadmium Yellow Pale on linen. A large, clean Diamond oil knife rocks ten degrees each way through twenty left-right sweeps, mixing the adjoining halves while leaving the outer colors mostly untouched.
Native Bloom Sketches recording at four times speed. Circular Oil Flat brush strokes lay down Cadmium Yellow Pale and Cerulean Blue on linen. A large, clean Diamond oil knife rocks ten degrees each way through twenty left-right sweeps, mixing the adjoining halves while leaving the outer colors mostly untouched.

Pigment data and reconstructed spectra

A screen gives us red, green, and blue values. A paint has a whole pattern of wavelengths it reflects and absorbs. We call its reflected fraction R(λ): 0 means none of the light at that wavelength comes back; 1 means all of it does. Two paints can look alike on screen and still mix differently because those patterns aren't the same.

The colors in these examples are Cadmium Red, Cadmium Yellow Pale, and Cerulean Blue from Bloom's Chartpak Grumbacher PTO catalog. Each has 36 measured reflectance samples, from 380 to 730 nanometers in 10 nm steps. Picking just three wavelengths makes the differences easier to see:

Selected catalog reflectance values, from 0 to 1
Paint450 nm550 nm650 nm
Cadmium Red0.02330.03050.7971
Cadmium Yellow Pale0.03330.74950.9048
Cerulean Blue0.12600.03600.0428

Catalog data source: 2

The recordings start with the catalog's sRGB display colors. Bloom reconstructs 38-band spectra from those colors; it does not use measured curves at each canvas pixel. Paints with identical sRGB inputs therefore get identical reconstructed spectra, even if the real paints would mix differently.

In short, Bloom reconstructs a spectrum from each display color, combines modeled absorption-to-scattering ratios at each wavelength, then converts the result back to a screen color. The equations below unpack those steps.

The mixing model

At each wavelength, Kubelka–Munk converts reflectance into a ratio of absorption K to scattering S, denoted Q:

Q(λ)=KS=[1−R(λ)]22R(λ)

That relation assumes infinite optical thickness: a paint layer thick enough that what's underneath no longer affects its reflectance. You'll often see it written R∞; we're shortening that to R. This part of the model doesn't describe film thickness or the canvas underneath.

Now choose how much of each color to mix. Let t be the input blend proportion for color B, leaving 1 − t for color A. The mixer squares those proportions and weights them by luminance, Y — the CIE XYZ Y component of each reconstructed spectrum. These are model weights, not measured pigment concentrations or tinting strengths. With the default tinting strengths of 1 for both colors, we get:

cA=(1−t)2YA,cB=t2YB Qmix=cAQA+cBQBcA+cB

Once those ratios are combined, this brings us back to reflectance:

Rmix=1+Qmix−Qmix2+2Qmix

Worked example

Suppose one paint reflects 80% of the light at a particular wavelength and another reflects 20%. Give them equal effective weights, cA = cB, and follow the calculation below. These are illustrative values, not measurements of the paints above.

  1. QA = (1 − 0.8)² / (2 × 0.8) = 0.025
  2. QB = (1 − 0.2)² / (2 × 0.2) = 1.6
  3. Qmix = (0.025 + 1.6) / 2 = 0.8125
  4. Rmix = 1 + 0.8125 − √(0.8125² + 2 × 0.8125) ≈ 0.3008

The result is about 30% reflectance, compared with 50% from a simple average. This calculation covers one wavelength. Applying the CIE 1931 2° color-matching functions weighted by the D65 standard illuminant across the spectrum gives XYZ values, which are converted to sRGB for display.

Bézier approximation

The color-mixing visualization includes an experimental “Spectral-Curve” mode. It takes the spectral results at t = 1/3 and t = 2/3, then fits a cubic Bézier curve in encoded sRGB space through those samples and the original endpoints:

B(t)=(1−t)3CA+3(1−t)2tP1+3(1−t)t2P2+t3CB

CA and CB are the input colors; P1 and P2 are the control points. The curve matches the selected samples but can differ between them. The comparison above shows both paths.

The fit is not used on the canvas. An evaluation across eight color pairs compared fitted paths with direct spectral results using CIELAB ΔE76. The mean error was about 2.3; the worst-case error of about 10.3 exceeded the proposed maximum-error target of roughly 3. This test does not establish an error bound for other colors.

The current visualization computes two direct spectral samples and a fit for every output pixel. It does not cache and reuse the curve. A speedup would require fitting once and reusing the curve for the same color pair. The paint under the canvas knife changes as it moves, so the pair is not fixed. The current implementation therefore performs two spectral evaluations instead of one, plus the curve calculations.

The canvas uses direct spectral mixing. The knife moves paint into adjacent areas, leaving streaks and small patches of the starting colors. The model does not simulate individual pigment particles.

Oil painting in Bloom Sketches

Oil brushes, palette knives, and spectral color mixing are available in the Mac and iPad beta. Oil painting overview.

Join the free beta on TestFlight

Sources

  1. Spectral.js 3.0.0, by Ronald van Wijnen. Source code, revision bb2b05c. MIT license.
  2. Chartpak Grumbacher PTO reflectance data, with Centore/RIT lineage.