Why does image texture used in displace modifier not give the correct height? I have got a custom heightmap-loader in Java, which converts each pixel of a Heightmap into a coordinate between 0 and 255, obviously with 255 being white and 0 being black.

The problem is, blender doesn't quite convert it the same.

Here's my rendering the heightmap with my own loader:


And here is the one created by blender:


Is it generally the same, White = up, black = down - But there are quite a lot of subtle differences. Certain places are higher, certain places are lower. And it generally is an incorrect mess.

To create the heightmap, I am following this tutorial. To sum it up, I create an image via a plane and use the Displace tool.

I just want an obj model which is 512 coordinates in size (ranging from 0 to 512) and has the same height as my custom generator, which simply sets the height directly to the amount of red on the heightmap at a certain coordinate.

And yes, the heightmap is black-and-white. So it doesn't matter if I get the red, green, or blue on the Heightmap, it'll be the same.

Why is it incorrect? What can I do to make it look exactly the same?
First of all make sure that the displace modifier's texture is mapped to the correct coordinates for your object (usually UV coordinates).

Now on to the settings on the display modifier.

The displace modifier will deform the the object based on the light/dark values of the image indeed. Using the default values, it will raise up the white parts (255) of the texture to 0.5 units and sink the dark values (0) to -0.5 and keep the mid-grey values at 0 in the Z axis. To alter the scale, change the Strength value to meet your needs. To make the dark values fall at 0 on the Z axis put the midlevel at 0.