Use gdal_calc.py
. By example :
gdal_calc.py -A crop.tif --outfile=level0100.tif --calc="100*(A>100)" --NoDataValue=0
to read as : `given an input -A (crop.tif), with output level0100.tif, when a pixel have a first band's value A>100 set value to 100. Else, set is as 0.
Within --calc=""
, you may set other conditions. If you want to set values such 100 < v < 200 to 100, then :
gdal_calc.py -A crop.tif --outfile=level0100.tif --calc="100*(100<A<200)" --NoDataValue=0
should work. (this last one was not tested)