Saving terrain to .j3o

Hello,

Can any one provide a code for loading/generating terrain from image heightmap and saving it as .j3o file?

Both topics are outlined in the wiki. The easiest way is simply using the terrain editor though ^^