[GRASS-user] Invert values of raster image

Wesley Roberts wroberts at csir.co.za
Mon Feb 23 05:16:01 EST 2009


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. I generated a reclass rule file but am not sure about the form of the file. In the grass help file the examples given show reclassification for only 5 or 6 classes. I essentially need to reclass 255 values.

Below is the format of my reclass file.

Many thanks for your help

Wesley

1 255
2 254
3 253
.
.
.
.
.
.
.
.
253 3
254 2
255 1




Wesley Roberts MSc.
Researcher: Earth Observation (Ecosystems)
Natural Resources and the Environment
CSIR
Tel: +27 (21) 888-2490
Fax: +27 (21) 888-2693

"To know the road ahead, ask those coming back."
- Chinese proverb


-- 
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