pouët.net

linear palette extraction

category: code [glöplog]
Also you will have some color inversions...
added on the 2013-03-19 19:01:17 by baah baah
I think what 216 wrote is very sensible, but I also love kb's suggestion of transforming this problem into Traveling Salesperson.
added on the 2013-03-19 19:43:52 by Adok Adok
baah: funny thing it doesnt look like a curve at all! but if one "zooms out" maybe those are just directions/arrows that in the end looks like a curve from a distance apart?
added on the 2013-03-19 20:29:49 by rudi rudi
errr... Hilbert's curve looks exactly like a curve, you can define a mapping from [0;1] to the red line. And the "magic" is that when the Hilbert's curve creation process is iterated to infinity the mapping goes from [0;1] (line) to [0;1]² (plane)
added on the 2013-03-19 22:10:27 by baah baah
Wouldn't an algorithm where you continuously find the closest colour to any given colour, and stick groups of colours together until you have one big group work?
added on the 2013-03-19 22:16:31 by FreeFull FreeFull
that plasma? thing is the image already has 40000 (irfan counted) colors due to compression. covert back to 256 you have a palette to sort.

if it's raw 256 just start at the corner and walk neighbors for all unique colors. weight rgb against the last. walk the closest match until you have 256 color or covered the whole picture atleast once.

just a simple thought. i didn't code that. i dunno know if that does?!? it's just how i'd tackle that one picture with it's flow.

d-.-b
added on the 2013-03-19 22:48:36 by yumeji yumeji
ohh... in case no unique color is found a farther walk in a random direction away from the last direction is a good idea to walk further. will compute endless maybe but you'll have it completely covered "somewhen". do you have time? :D
added on the 2013-03-19 22:52:07 by yumeji yumeji
i remember using a palette sorting tool made by kvark/prone back in the MS-DOS days. Perhaps you can find it somewhere. I think it was called phone palette or something
phone=phong
rasmus: impossible to find it.
added on the 2013-03-21 17:16:39 by rudi rudi

login