My advice...free...worth every penny.
Easiest is Backhoe, which runs on mac only. It can read an existing terrain and modify it, or it can create a new one from scratch. Play with it for awhile, there is no thorough documentation, so you have to learn my doing.
You can use Photoshop or the Gimp, and the Gimp is probably easier for SL terrain files. To use image tools, you must be familiar with editing channels! rtfm
For whatever reason, SL chose to represent terrain as a 13 channel camera .RAW file (which photoshop, gimp, and other tools can process). Unfortunately, these image tools show the terrain as a top down 256x256 image, where white is high, and black is low, and gray is somewhere in between. Backhoe gives you a 3D view, as you would hope for (see example two posts down). In the Gimp and in Photoshop it is very hard to know what you are doing, especially for a beginner.
There are some reports about a tool called TerraGen, about which I know nothing.
Here's my short, short guide...
Create a 256x256 pixel image. Each pixel will represent 1 sq.m. of terrain, with 0,0 at the Southwest. TIP: You need to work in the channels, not in the layers. Forget layers

for this.
Overview
Height data will be in the red channel, channel 1.
Multiplier data will be in channel 2. (More on this in a moment.)
Water height will be in channel 3.
The rest probably don't matter now, but if this is an existing terrain, don't mess with them. They contain data about parcels, for sale, health, and so on.
The multiplier: This is tricky. For beginners, Set all the values to 127. Do this by setting the rgb values of your foreground color to 0,127,0, and painting the channel 2. 127 represents a height multiplier of 1.0. More on this later.
Water height: if you are adjacent to other Linden water, this layer should contain a value of 20 everywhere. Set foreground color to 0,0,20 and paint channel 3.
Height data: In channel 1. a value of 0 now means 0 meters, and a value of 255 now means 255 m. Paint with shades of RED in channel 1. That is, your colors should be 0,0,0 to 255,0,0 while you paint in the red channel. Imagine you are looking down from space, and black is the sea bottom and white the tops of the mountains. By the way, the Gimp has autogeneration of terrains in the patterns tool. They look pretty cool.
Precision adjustment: So, now you can create terrain that goes from 0 to 255 meters height on a 1 meter grid. however, the minimum ht change from one meter to the next is also 1 meter, which is a lot. Suppose that what you really want is for the min change to be 1/2 meter. This is where the multiplier channel comes in. Go back and paint the multiplier channel with the value 64 instead of 127. This changes the *scale of height changes*. 0 is still 0 meters, but 255 (white, or actually red) now represents 1/2 of 255, or about 127. The step is now 1/2 meter. On the downside, the highest point you can represent is 127 meters.
Suppose you want even finer changes from one square to the next. Then, reduce the multiplier layer to 32 everywhere. The min step is now 1/4 meter, but the highest point possible is about 64 meters.
So, in fact, one of the first decisions you should make is the multiplier layer, especially in Backhoe. Set a multiplier to give you the highest point you want, but no higher. This will give you the best possible precision.
So, now you have this data in channels 1, 2, and 3. What next? The image must have 13 channels, so add ten more, or not if you already had some extras. Put them below 1, 2, and 3. If you are creating, fill them with 0.
Then, save the file as a camera .raw file, interlace.. View it in Backhoe. Buying a $200 used mac might be worthwhile just for this

or, email it to me, and if I am not deluged with requests, I will display it in 3d and send you a picture

[email]lee.ponzu@yahoo.com[/email] (see how nice I am?

Note on reading raw files: You have to tell the tool how the file is structured, and if you don't know, too bad. So, when you read in a .raw from SL, it is 256x256, 13 channels, interlaced.
Good luck. Post questions here.