Perhaps not what you were looking for, but I've just started working on a palette module for the following use cases
- Applying false colour to a video image
Applying specific colours to a decaying trail
Quickly recolouring existing scenes to fit within a different palette range
I wanted to be able to feed in an image of a desired palette, and to have some readily accessible presets.
It's very much an experimental and unfinished work-in-progress, and I'm adding functionality as ideas occur to me.
Attached is my current ISF shader version and a demo Magic project. Probably lots of poor coding in the shader. certainly lots to be tidied up. I make no claims other than "it's functional". Code is largely from Shadertoy, inspired and developed from this shader
https://www.shadertoy.com/view/Nd3fR2, but also with a couple of cosine-based palettes using IQ's palette function
https://www.shadertoy.com/view/ll2GD3 with parameters generated here
http://dev.thi.ng/gradients/.
As well as the built-in palettes you can use the second input pin to feed in an external (vertical) palette image. The external palette image is sampled along a central vertical line, and as the external palette is an image it's easily masked or scaled to give further control. An external palette image could be composed of a number of adjacent palettes, selection between them made by introducing a horizontal translation of the composition.
I'll probably add the ability to sample a horizontal palette, also to adjust the range over which a palette is sampled so that a limited colour range could be selected.
Various components of the input image can be selected for processing:
- Luminance
Max Component
R
G
B
Output can be selected between
- Selected Palette
All palettes
Component used as input to the palette
Applied Palette
Comments and suggestions welcome!