It is currently Sun Jun 25, 2017 12:15 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: SOLVED Some way to create a high-entropy color palette?
PostPosted: Tue Apr 18, 2017 4:33 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Hi, all,

Happy Eastertide.

I deal a lot with heightmaps, which you can take to be grayscale images for which pixel values change "smoothly" in any direction.

It would be helpful sometimes if I could "see" adjacent contours of individual pixel values "next" to each other. I think what this means is that I'm looking for a way to map values which are adjacent in the original to values, gray or color, which are "far enough apart to be easily detectible" in a new pseudo-colored image.

I wonder if it might work to work with the 2 half palettes of continuous shading or color, 0-127 and 128-256, and subdivide each into 4 parts, for a total of 8 subpalettes. A pixel with value PV in the range 0-127 will be assigned a new value from an offset into a subpalette in the other half-palette, which subpalette being determined by a mathematical expression like PV mod 4, and with an offset being the same as the PVs own offset into its original subpalette.

For example, for two contours lying next to each other at PV=100, and PV=101.
100 mod 4 = 0 => 1st subpalette in top half-palette, 128-159, and PV=100 is in the 4th subpalette in the bottom half-palette, 96-127, with an offset of 5
101 mod 4 = 1 => 2nd subpalette in top, 160-191, and PV=101, is in 4th subpalette too, with an offset of 6

So PV=100 would map to PV=128+5=133
while PV=101 would map to PV=160+6=166, 33 rgb away.

Alternatively, I'm looking for an optimally noisy/chaotic/high-entropy pseudocolor gradient in which colors adjacent to each other in the original map to colors on opposite sides of the color wheel.

I selected the tropical colors map for an initial experiment with Colors->Map->GradientMap, which does give a hint for what a result might look like, but still results in grayscale values near each other mapping to shades near each other.
Attachment:
BW.png
BW.png [ 61.51 KiB | Viewed 397 times ]
Attachment:
PC.png
PC.png [ 121.84 KiB | Viewed 397 times ]

I had a brief notion that simply mapping levels to either 0 or 255, based on being even or odd, would be interesting, but I want to the mapping to be reversible.

I also just had an inspiration that G'MIC's computation engine might be a good place to experiment.

(Interesting: "What would you expect to happen if you continued to apply Colors->Map->GradientMap to the pseudocolor result?" For the example above, the output tends to monochromatic. "Is there a palette which will guarantee this convergence will not happen?")

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Last edited by gramp on Thu Apr 20, 2017 12:18 pm, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Some way to create a high-entropy color palette?
PostPosted: Tue Apr 18, 2017 4:40 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Actually, I got something more like what I am after with the Skyline gradient and Map->GradientMap.
Attachment:
PCskyl.png
PCskyl.png [ 18.94 KiB | Viewed 393 times ]

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: Some way to create a high-entropy color palette?
PostPosted: Tue Apr 18, 2017 10:26 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Thinking aloud with a trivial palette of 16 "colors"
0123456789abcdef
I would like a new palette where the colors are (a) not adjacent to each other, and (b) "far" from the colors they are adjacent to:
08192a3b4c5d6e7f
is one possible, but it has the disadvantage that colors only differing only by 2 will map to colors adjacent to each other.

Let's say original colors need to be separated by at least 4 to map to adjacent colors:
0123456789abcdef -> (maps to) 048c159d26ae37bf
created by counting sequentially 0123 and then continuing by "infilling" 0123 with 4567: 04152637" and infilling again "048159..." etc.

If we say original colors must be separated by 8 to map to adjacent colors:
0123456789abcdef -> 06c28e4a17d39f59 appears to result in originally adjacent colors being separated by at least 6 in the output.

What's the general solution for interleaving N colors? :^)

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: Some way to create a high-entropy color palette?
PostPosted: Wed Apr 19, 2017 7:40 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Going back to my suspicion that G'MIC might have something to help, I used G'MIC->Rendering->Turbulence, and FractalNoise on a 12Hx256W canvas, getting 12 different 1x256 sequences of interlaced colors. (I had earlier imagined that intermixing colors in a gradient the way I desired would result in the gradient looking gray.)

I picked one of them for a candidate gradient. (I post a Colors->Info->Histogram to show that any color appears at most 4 times among the 256 pixels: ideally, each should appear only once.)
Attachment:
GmicTurbulenceFracnoise.png
GmicTurbulenceFracnoise.png [ 45.98 KiB | Viewed 299 times ]


Now, I just need that "Sample Gradient Along Path" script of Rob A's, but I can't find it in my menus (2.8)... :^(


Attachments:
Experiment_CreateRandomGradientForRemappingAdjacentContoursToWide-apartColors.xcf [4.08 KiB]
Downloaded 11 times

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Last edited by gramp on Thu Apr 20, 2017 12:18 pm, edited 1 time in total.
Top
 Post subject: Re: Some way to create a high-entropy color palette?
PostPosted: Thu Apr 20, 2017 11:10 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
> Now, I just need that "Sample Gradient Along Path" script of Rob A's, but I can't find it in my menus (2.8)... :^(

Found it (again)! (I'm always a little confused by the term "menu", as in the script's instructions "find it on the Gradients menu".

"Sample Gradient Along Path" is offered as one of the list of "gradients" in the pull-down on the Gradient tool. (I didn't see it because the size of my tool window was too narrow to display the entire name, so the script appeared as "Sample Gradient..." of which there were already a number of others, causing me to mistake it for one of their group.

However, now having found it, it appears that it might be graylevel-only. I investigate.

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: Some way to create a high-entropy color palette?
PostPosted: Thu Apr 20, 2017 12:15 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
Okay, got it, although by an Edisonian ("Put electricity through everything until you find one that doesn't burn up!") instead of a preferred Newtonian ("Let's start with the math of the thing.") approach.

I also found trandoductin's implementation of sampling a gradient along a path, and after some false starts was able to get a high-entropy palette of the sort I sought. (By high-entropy, I've been meaning high variations of values among locations "close" to each other on the palette.)

Starting with my initial b&w heightmap, and running Colors->Map->GradientMap with a new palette derived from tt's plug-in, I got this finer-grained result, making it easier to perceive where elevation changes occur than in the original's continous-ness.
Attachment:
HE.png
HE.png [ 216.69 KiB | Viewed 268 times ]


Thank you for reading along.

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: SOLVED Some way to create a high-entropy color palette?
PostPosted: Thu Apr 20, 2017 12:20 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
I just realized that for the use I prescribed, a simple palette of repeating 16 colors would have filled the bill nicely.

Wonder how to create one... :^)

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Top
 Post subject: Re: SOLVED Some way to create a high-entropy color palette?
PostPosted: Thu Apr 20, 2017 1:13 pm  (#8) 
Offline
GimpChat Member

Joined: Jan 20, 2013
Posts: 6162
Location: roma, italy
You may also use these gradients, if you like.
Attachment:
mandelbulb_gradients.zip [1.6 MiB]
Downloaded 21 times

_________________
Vanitas vanitatum et omnia vanitas.


Top
 Post subject: Re: SOLVED Some way to create a high-entropy color palette?
PostPosted: Thu Apr 20, 2017 1:19 pm  (#9) 
Offline
GimpChat Member

Joined: Jan 20, 2013
Posts: 6162
Location: roma, italy
This is a sample outcome, using your B&W image.
Attachment:
BWmapped.png
BWmapped.png [ 97.86 KiB | Viewed 262 times ]


not so extremely detailed as in your outcome, but quite good.

_________________
Vanitas vanitatum et omnia vanitas.


Top
 Post subject: Re: SOLVED Some way to create a high-entropy color palette?
PostPosted: Thu Apr 20, 2017 1:28 pm  (#10) 
Offline
GimpChat Member
User avatar

Joined: Apr 20, 2011
Posts: 188
Location: Dane-ish Co., West Gonsin
@dinasset
There. Are. Four-hundred-and-sixty-nine. Gradients. In. That. Zip. File. [Edit: 468. I counted one twice earlier...]

8^0

(That's just about every gradient there is!)

My humble thanks. I like the rendering you picked. Bedeviling question: "Which gradient did you use?" ;^)

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."
And another thing, as you get older, when time is increasingly the most
precious thing you have left, you waste most of it looking for your stuff.


Last edited by gramp on Thu Apr 20, 2017 1:41 pm, edited 1 time in total.

Top
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Gimp Fleshtone Color Palette

6

No new posts G'MiC with high res pic

1

No new posts High five!

13

No new posts Attachment(s) Choosing palette

27

No new posts Using a limited palette

13



* Login  



Powered by phpBB3 © phpBB Group