You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Extension - Spatial Analyst forum

Change Pixel values in an image   Monique Lapalme Sep 15, 2005
Re: Change Pixel values in an image   Ray Carnes Sep 15, 2005
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Change Pixel values in an image 
Author Monique Lapalme 
Date Sep 15, 2005 
Message I have satellite images in png format. I have been able to load then up in Arcview and project them properly. The images show clouds with pixel values ranging from 0 to 254. the pixel value of 255 (white) is reserved for the existing geography(boundaries, rivers etc...) all with the pixel values of 255. I would like to strip out these values of 255 (since they do not represent clouds) and replace them with an average of the surrounding cells (excluding in the average calculations values of 255). My goal is to only have the cloud formations on the images.

I also have several hundred images to process. So I need a solution that can batch process the images.

Thanks 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Change Pixel values in an image 
Author Ray Carnes 
Date Sep 15, 2005 
Message You can do this with Spatial Analyst.

See "An overview of the Generalization tools" in the online help for an introductory discussion of the kinds of tools you will most likely want to use:
http://webhelp.esri.com/arcgisdesktop/9.1/index.cfm?ID=2931&TopicName=An%20overview%20of%20the%20Generalization%20tools&rand=184&pid=2930

You will probably want to use Nibble. Nibble allows selected areas of a raster to be assigned the value of their nearest neighbor. This is useful for editing areas of a raster where the data is known to be erroneous.

You need to create another grid, called a MASK, with the NODATA value in each of the cells you want to replace. You can do this with the CON tool. Con performs a conditional if/else evaluation on each of the input cells of an input raster.

You can use Nibble and Con at the command line which means they can also be used in a script.

See "HowTo: Repeat-run a geoprocessing tool-batch style processing" for help on writing a script that loops through your images.
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=26892

Refer to the product documentation and/or the help for more information about spatial analyst, geoprocessing and scripting.

Ray Carnes,
ESRI Technical Marketing.