5.- Scaling.

If you use Photoshop this is the end of the mini-tutorial, you can get the final image and start working with it.

But I use GIMP and we won't get 16bit image support until version 2.8 (if they don't change the milestone again) so I have to scale the images to 8 bits.

We'll use gdal_translate command for rescaling, but we're also using gdalinfo for getting some info first. With gdalinfo we can get information about the maximum and minimum of the histogram, we will use this information for rescaling to 0~255 greyscale with gdal_translate. For getting the info we type

Code:
gdalinfo -hist mosaico_rer.tif
we are looking for a line wich is similar to " 256 buckets from -32835.4 to 1757". -32835.4 is a way to say NULL or no data, and 1757 is the maximum.

Code:
gdal_translate -ot Byte -scale 0 1757 0 255 mosaico_rer.tif mosaico_rer8.tif
With the -ot option you can set the output data type, we are using 8 bit (1 byte), and again the output format is GeoTiff, the standard one; so we're not using the -of option. With the -scale option you can define the match between the input (0~1757) and output (0~255) range.

Now you can use the image in GIMP.