I created this post with the hope that a GIMP script might be written: I apologize that this is not about a script, per se.
However, having acquainted myself with the clear
exposition of GGR by user jsbueno on stackoverflow, I've thrown together a Perl script to create a gradient of randomized colors which may become grist for someone else's script mill, to wit:
#!/usr/bin/perl
open FILE, ">New256color.ggr" or die $!;
print FILE "GIMP Gradient\n";
print FILE "Name: New256color\n";
print FILE "256\n";
for($seg=0;$seg<1;) {
$segm=$seg+1./512.;
$segr=$seg+1./256.;
print FILE "$seg $segm $segr ";
$red=rand();
$green=rand();
$blue=rand();
print FILE "$red $green $blue 1 ";
print FILE "$blue $red $green 1 "; # 2nd, blend of L and R colors across segment
#print FILE $red $green $blue 1 "; # Orig. pure color across segment
print FILE "0 0\n";
$seg=$segr;
} # for seg
close FILE or die $!;Actually, there are more than 256 colors, I think. Originally, I used the same values of RGB for both left and right endpoints of each segment, but at the last moment, I got the bright idea to alter the right-hand endpoint in a trivial way. The result appears to be that GIMP creates a new mini- or micro-gradient on each of the 256 segments. However Colors->Info->Histogram reports pixel counts only for values 0-255, so although ANY collection of 256 colors is possible, only 256 are stored in a palette. (No doubt long-time users of GIMP are much more familiar with its constraints than I am.)
Here's a comparison between (a closeup of) the 2nd (blended segments, above) and original gradients:
Attachment:
twotypesofrandompalettes.png [ 2.02 KiB | Viewed 781 times ]