Just upgraded GeoServer to latest version (2.15). I used to apply bicubic interpolation method to render some WMS basemaps in the previous install (v 2.10) but now when displaying the same maps, odd colors appear because of the interpolation.

Here some examples:

enter image description here enter image description here

The colors are Ok when I use other interpolation methods (e.g. Nearest Neighbor). However, I still want to use Bicubic because results were better when I used it in the previous install.

There have been other changes because the host server has been upgraded as well, so for example the new server runs Java 11 while the old one ran Java 8.

Are there any modifications that I could apply whether in Geoserver or in Java (or anywhere else) so bicubic interpolation provides good results?

  • is that a paletted image? rather than plain rgb? – Ian Turton May 24 at 16:10
  • They are all paletted images, 256 colors – Maik May 28 at 15:03

There have been a few fixes between 2.12 and 2.15 that may have caused interpolation to start working on paletted images.

So the issue is that any method except nearest neighbor will give the wrong result for these images as each pixel is a value that corresponds to a specific color, so picking an average (or interpolation) will give a random color not one that falls between the two pixels.

Here are the first 10 colors from a similar OS tile to illustrate the issue:

Color Table (RGB with 256 entries)
    0: 255,246,238,255
    1: 98,65,74,255
    2: 213,230,131,255
    3: 90,82,82,255
    4: 255,148,131,255
    5: 255,90,98,255
    6: 238,246,246,255
    7: 57,24,24,255
    8: 222,98,98,255
    9: 115,74,65,255
   10: 8,16,8,255
  • Thanks Ian, that sheds some light to the issue. Is there a workaround to be able to use bicubic? – Maik May 28 at 15:04
  • I makes no sense to use bicubic, you need to pick one or the other color. There is no way to interpolate between the pixel values, e.g 1 above is purplish, 2 is greenish and 3 is gray so there are no steps from one to the next – Ian Turton May 28 at 15:22
  • Thanks, your answer explains the odd colors, so I'll accept it. The workaround was removing the Palette to be able to use bicubic. I am using Bicubic interpolation because the other methods produce bad results, but the downside is more time and processing needed for each request. I guess I'll have to throw a new question for the rendering issues using Nearest Neighbor. – Maik Jun 12 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.