I need to normalize the values attained from a band ratio to 0-255. I'm using QGIS. How do I do this? Any ideas?
The following will stretch your data to 8-bit (0-255).
smin=0; smax=255 ( x - min(x) ) * (smax - smin) / ( max(x) - min(x) ) + smin
It should be fairly easy to translate this to the raster algebra syntax in your software of choice. You will just need to know what the min and max values are in your raster. If the raster is the result of a band ratio then it is safe to assume -1 to 1 and the syntax should look something like this.
NewRaster = ( OldRaster - -1 ) * 255 / ( 1 - -1 ) + 0
You can use gdal_translate utility. Use the option -scale [src_min src_max [dst_min dst_max]] with src_min and src_max as current min/max values from your data and 0,255 as dst_min,dst_max. Without the square brackets.
If you have installed QGIS with OSGeo4W package, you may have the terminal program called 'MSYS'. Open that and just use the gdal_translate command. If not, from within QGIS choose Raster -> Conversion - > Translate. Choose your files and options. At the bottom of the window the full gdal_translate command will be displayed. Click edit and add the -scale option.