# How do I avoid interpolation artefacts when scaling up a heightmap?

I am using a bicubic interpolation algorithm in order to upscale a height map, and I am noticing some artifacts around the pixels boundaries. However, these artifacts don't seem to appear when I use a simple cubic interpolation (spline).

Could it be because the bicubic interpolation doesn't guarantee the second derivative to be continuous, unlike the cubic spline ? If so, is there known algorithms that have a continuous second derivative ? Otherwise, is there a way to deal with these artifacts ?

Linear interpolation (shows the pixels boundaries):

Bicubic interpolation (artifacts visible at pixels boundaries):

Cubic interpolation (no noticeable artifacts):

I tried several bicubic formulas, which gave me the same results. Here are some examples:

• for me the bicubic version is the best, it keeps high frequencies and looks pretty good. you say there are artefacts but they are minor and not worth the horrible loss b splines are giving you. my opinion though. Feb 13, 2014 at 1:21
• @v.oddou I think that the high frequency feeling you describe is partly due to the artifacts themselves. It doesn't show well in this image, but the terrain is really squarish from some angles, and depending on the sun position. It's even more apparent when the normals or the slopes are displayed. That being said, it's true that the b-splines smooth out the terrain a lot (no more sharp peaks). I am still searching for a better alternative.
– deck
Feb 13, 2014 at 9:16

In Ken Perlin's paper on improved noise, he mentions a very similar problem. The cubic used in the original noise paper creates discontinuities at the integer boundaries due to the properties of its derivatives. In his revised paper, he proposes an interplant of 6t^5 - 15t^4 + 10t^3 to address those issues.