How would I go about makiing a colour ‘snap to’ the closest match from a predefined selection?
I’m looking for a way to integrate colour schemes into my work and it would be great to for example take a video stream pixel’s colour and turn it from it’s existing colour into one of a number of colours in a palette, based on how ‘close’ their hues are.
Any related tips on how people work with colour schemes in their work would also be gobbled up with glee!
the trick is to see a color simply as 4 values, if we leave the alpha, its 3 values. say we have RGB color ‘space’. then a color is a position in that space, which is 3 dimensional. so its finding the closest position to a given position.
maybe HSL or HSV space give other results, havn’t tested that…
West’s is pretty much what I need, as I just want to match and replace the hue and leave the Saturation and Luminance as original.
A problem though, it’s not spreadable…
I’ve attached an example showing the jist of what I’m trying to do, hooked up to West’s solution. Just load a video in to the filestream.
You’ll see that the output pixels change colour, but only to one hue value at a time. What I need is for every pixel to match the closest one of the palette hues.
You never mentioned you wanted it spreadable ;) When you use a basic CAR (or CDR for that mather) you alwyas get 1 slice, the first (or the last) so that can never be spreadable.
How many colors in your palette do you have? To make it spreadable I think you have to resample your palette with palette * pipet spread, that can give a high spreadcount, so be careful.
Than you need a binsized sort, wich we don’t have (!!), so a binsized bounds from the the plugin pack (thnx Woei!!) should work. The binsized nodes are the ones with (Spreads Advanced) in it.
Want to figure out how to do is with the 3D colorspace from tonfilm, but it should work the same.
edit: note one Resample is set to repeat, and the other is set to Point!!
Hope you create a userpage and show us some results :)
Bins are to group spreads inside spreads (so to speak), so yes multiple spreads in a single spread. It is soo very difficult to explain I still not sure how to explain it in my video tuts.