Better gradients

Does this sound interesting?

I’m mostly surprised at how bad the “typical” examples look - is that really what most tools do?

2 Likes

Top row looks like linear interpolation between color keypoints, so with discontinuties at the keypoints. Using splines or just bicubic interpolation should already avoid that. I think there are no particular need to do that in Lab* (linear RGB should be OK too).

1 Like

Remember this post? :wink:

Source: CET Perceptually Uniform Colour Maps

A quick test:

test :
  srand 0 6,1,1,3,u(255) round
  +r. 256,1,1,3,3
  +srgb2rgb[0] r. 256,1,1,3,5 rgb2srgb.
  rm[0] r 256,64,1,3 a y r 300%,300%

Top row : linear interpolation in sRGB.
Bottom row : cubic interpolation in linear RGB.
Very close to the OP.

3 Likes

Not interesting.

It’s common knowledge that linear interpolation suck. Catmull-Rom, or any cubic method is better.

Linear RGB is not designed to be perceptually hue-linear, but to model light mixing. So… those geeks forget to precise something important: are we interpolating a GUI color selector or an image effect ?

Lab is fine-ish if you want to provide a color palette in GUI, for color selection, but not for image effects.

Another test, with different colorspaces and interpolation methods.

Clearly, sRGB sucks all along, as well as Linear interpolation.
Other results are roughly comparable.

1 Like

Lab sucks too. You get grey fringes between blue and green, but the real grey is actually swallowed by the green patch.

1 Like

Ah yes, I haven’t noticed that at a first glance, but now I see it!
I’d better go to sleep :slight_smile:

Another example, with more colors and Thin Plate Splines interpolation added (last row).

Out of gamut issues on magenta ?

Yes, I had to clamp the values as the cubic/lanczos and tps generate oog colors.

Now, in spectral… :slight_smile:

1 Like