A downloadable tool for Windows

Download NowName your own price

The Palette Interpolator is a Java-based tool to interpolate a sufficiently linear colour palette. Instead of simple linear or bilinear or spline interpolation, this tool uses mathematical analysis and statistical regression to generate any number of colours.

How it works:
Simply run the executable and wait for the GUI to pop up. Click the "Load File" button and select an input image to load. Note: Depending on the size of the image and the number of colours in it, loading and regressing the palette might take a moment. When the palette is loaded and shown in the "Input palette" field, you can enter a number of colours in the text box and press ENTER (or click the "Interpolate Palette" button) to generate that amount of colours. By entering another number and pressing ENTER again, you can interpolate the palette without having to load a file again. By clicking the "Save Output" button afterwards, you can save your results in an image file.

What it can be used for:
Pretty much anything! You can expand palettes with more colours, you can contract them with less. You could even input a palette line and request the same amount of colours out, resulting in the palette being spaced more evenly while keeping that touch that makes it unique. Whatever art purpose you need colours for, this can make them for you. I recommend a palette of 4-5 colours minimum and no more than around 10-15 for the tool to work best.

Why it works
Any RGB colour can be expressed as the sum of its primary colours, the Red, Green and Blue components. Any colour also has an implied value, the luminance, which says how bright a colour appears to the human eye. Blue light appears darker than green light because of the way our eyes percieve colours. It is possible to plot the red, green and blue components of a colour against the lumiance. With these points, it's possible to find regression functions that which can be evaluated to find the values of each component at any luminance. The sum of all 3 make a colour.
To get any number of colours, the functions are evaluated at evenly spaced points across the range of luminance in the input palette. Ideally the darkest and brightest colours are the exact same as in the input palette.

Warning: It is possible that the output palette may not line up with the input palette.
Due to the limitations of regression, it's possible that the found function over- or underfits the data, meaning the resulting values might be completely off. This may happen if the given palette has an outlier colour with a higher/lower luminance than its place in the palette. If the output colours are very different from the input palette, try to find and remove such an outlier colour before trying to interpolate the palette again.

Download

Download NowName your own price

Click download now to get access to the following files:

PaletteInterpolator.zip 85 kB

Development log

Comments

Log in with itch.io to leave a comment.

I would have liked to try this tool, uploading it to virustotal is detected as a virus, could you do something about that?

(1 edit) (+1)

You know, I never really considered throwing my tools into VirusTotal before. Checking it, it seems to trip a few trojan detectors and I don't know if I can do anything about that. The tool needs to write/read data else it wouldn't be able to do what it's supposed to do. If it makes you feels safer, you can run the JAR file without needing the executable by opening a console and entering the following line into it.

java -jar [JAR location]

Funnily, looking up the "detected viruses", someone had the same false positive playing Bridge Constructor: Portal a few years back.

I thank you for the information