On 30 May 2002, at 17:44, Gordon Royle wrote: > What is the format of the GIMP gradient files? > > For example, the gradient "default" which goes from black->white with > a grey midpoint has the following text format: > > GIMP Gradient > 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 > > and the gradient French flag has the format: > > GIMP Gradient > 3 > 0.000000 0.166667 0.333333 0.000000 0.000000 1.000000 1.000000 > 0.000000 0.000000 1.000000 1.000000 0 0 0.333333 0.500000 0.666667 > 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 > 1.000000 0 0 0.666667 0.833333 1.000000 1.000000 0.000000 0.000000 > 1.000000 1.000000 0.000000 0.000000 1.000000 0 0 > > So the first number is obviously the number of segments in the > gradient, and therefore each line must describe one segment. > > The first three values are the left/middle/right end points of the > segments respectively. > > this leaves me with 8 floating point numbers and 2 integers to > describe the three colours - the first 3 numbers seem to be the > RGB values of the left end point. But what the heck are the > remaining numbers? They don't seem to correspond to anything ! What helps for me usually is look at the code for loading and saving GIMPy things, in this case gradients. It depends a bit on who coded and how well-chosen variable names are, but most of the time numbers are loaded in the order they are written and you should be able to make some sense of them by looking at the variable names. If you don't want to download the GIMP's source, you can study it through <http://cvs.gnome.org>. Another way of finding out may be to look at the PDB (<Toolbox>/Xtns/Database Browser..., if I am not mistaken) and see if there are any public functions for manipulating I am sorry if this is not very helpful, but I am busy. Perhaps someone else could give a more exact answer. -- branko collin collin@xxxxxxxxx