[GRASS-user] Invert values of raster image

Wesley Roberts wroberts at csir.co.za
Mon Feb 23 08:02:11 EST 2009

Thanks Moritz,

r.recode did exactly what I needed.

much appreciated

>>> Moritz Lennert <mlennert at club.worldonline.be> 02/23/09 1:02 PM >>>
On 23/02/09 11:16, Wesley Roberts wrote:
> Dear list.
> I have a raster file with values coded in 8 bit grey scale 0-255. I
> would like to invert the raster values so that 255 is now 0 and 0 is
> now 255. I have not found an out of the box solution in grass but
> have tried the r.reclass function. 

How about r.recode with a rule such as:



> I generated a reclass rule file
> but am not sure about the form of the file. 

You need a '=', so



This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

More information about the grass-user mailing list