SpectralNN Paint Mixer

Physical paint mixing with neural residual correction.

Instead of mixing in plain RGB, SpectralNN Paint Mixer starts from a subtractive physical baseline and uses a neural network only to correct the remaining residual errors. The demo below lets you inspect both outputs from the same recipe.

Recipe Builder

Click a swatch to add it to the recipe. Clicking it again increases its parts, and you can also add your own colors below.

Live Result

Start with a simple two-color recipe to inspect both runtime paths.

Ingredients
2
Total Parts
2

SpectralNN Output

Physical base model plus neural residual correction.

#FFFFFF

Physical Base Model

The same recipe before neural correction is applied.

#FFFFFF

Both panels are computed from the exact same recipe, so the difference you see is the residual model alone.

Use It

Drop the mixer into JavaScript or Kotlin in a few lines.

The runtime API stays intentionally small: colors, integer parts, and a mixer entry point. Switch languages below to see the same recipe shape in both runtimes.

Install

npm install @rtarik/spectralnn-paint-mixer

Mix

import { MixPortion, PaintMixers, SrgbColor } from '@rtarik/spectralnn-paint-mixer';

const mixer = PaintMixers.default();
const result = mixer.mixOrNull([
  new MixPortion({ color: SrgbColor.fromHex('#E53935'), parts: 1 }),
  new MixPortion({ color: SrgbColor.fromHex('#283593'), parts: 1 }),
]);

console.log(result?.toHexString());

Paint-Aware

Starts from a subtractive spectral mix instead of straight channel interpolation.

Inspectable

Compare the corrected result against the base engine to see exactly what the residual model adds.

Portable

Use the same model artifact and fixture corpus across JavaScript and Kotlin.

Technical

Read the architecture

Dive into the two-stage pipeline, the shared artifact contract, and the reasoning behind the residual correction model.

Open technical page

Repository

Library repository

Browse the source, release notes, and deployment workflows for the standalone library repository on GitHub.

Open GitHub repository