It is currently Fri Mar 29, 2024 8:52 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  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: 287
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 3241 times ]
Attachment:
PC.png
PC.png [ 121.84 KiB | Viewed 3241 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."


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: 287
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 3237 times ]

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


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: 287
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."


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: 287
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 3143 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 105 times

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


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: 287
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."


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: 287
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 3112 times ]


Thank you for reading along.

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


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: 287
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."


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
User avatar

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

_________________
"Where am I ?"


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
User avatar

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


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

_________________
"Where am I ?"


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: 287
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."


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

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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
In my folder it's numbered 468, but I renamed them when downloaded and selected, thus I'm not sure.
Best strategy for your objective is:
- load the full set
- check those with the highest number of colour slices and discard the others
(My choice was a bit different, I didn't look for the highest number of slices, I just selected among those based on my aesthetical taste).

_________________
"Where am I ?"


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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
repeated and mapped using (my) nr 372
Attachment:
BW-mapped-372.png
BW-mapped-372.png [ 92.59 KiB | Viewed 1010 times ]

_________________
"Where am I ?"


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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
and this mapped with 231
Attachment:
BW-mapped-231.png
BW-mapped-231.png [ 87.55 KiB | Viewed 1009 times ]

_________________
"Where am I ?"


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

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
(I corrected my number, confirming 468.) I agree: the key thing is to whittle these down to the ones that suit our needs and tastes.

IF I understood the format of GIMP's .GGR gradient file, I could write a Perl script (I'm sure) to parse them for the numbers of unique colors.

And even create that optimal scientific, "Newtonian", gradient I alluded to earlier.

Surely THIS must be Artistic?
Attachment:
USA_gradmapped_mandelbulber_284.png
USA_gradmapped_mandelbulber_284.png [ 456.49 KiB | Viewed 1009 times ]

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
very nice!

_________________
"Where am I ?"


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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
From an "artistic" viewpoint, what about this mapping? (657)
Attachment:
agita-keiri11-1024x675-MB657.jpg
agita-keiri11-1024x675-MB657.jpg [ 515.99 KiB | Viewed 1007 times ]

_________________
"Where am I ?"


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

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
I :oops: wrote:
> IF I understood the format of GIMP's .GGR gradient file, I could write a Perl script (I'm sure) to parse them for the numbers of unique colors.

In StackOverflow (not StackExchange), I read that the "format" of the .GGR files is, :oops: :oops:, "text."

Sure enough "% head pg-patdavid-tmp#1.ggr" has this header information: (I'm not sure where I got this.)
GIMP Gradient
Name: pg-patdavid-tmp #1
1
0.000000 0.500000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0 0 0 0

That blend looks like this:
Attachment:
pg-patdavid-tmp#1gradient.png
pg-patdavid-tmp#1gradient.png [ 139.3 KiB | Viewed 1007 times ]


I'm going to ponder the link some mo.
~
~
~

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


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

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

Joined: Apr 20, 2011
Posts: 287
Location: Dane-ish Co., West Gonsin
[quote="dinasset"]From an "artistic" viewpoint, what about this mapping? (657)

Very Nice. May I guess that the underlying image is color, and not like my earlier B&W examples?

_________________
--
GraMP
"Once you sit on your glasses, the rest of getting old seems obvious."


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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
Third line in the text of a gradient is the number of slices.

_________________
"Where am I ?"


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

Joined: Jan 20, 2013
Posts: 14804
Location: roma, italy
Yes, I started from a (very nice) colour painting

_________________
"Where am I ?"


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts How To Create A Color Palette In Gimp (Video Tutorial)

8

No new posts Attachment(s) Benjamin Moore Gray Color Palette (Orange Palette Added)

26

No new posts Attachment(s) The High Altitude Mobiles Of Maldonia

4

No new posts High Intensity Texture Mapping

0

No new posts Attachment(s) More Wood Palette

4



* Login  



Powered by phpBB3 © phpBB Group