Pansharpened Raster Color Changes After Clipping

1217
4
06-22-2018 11:16 AM
Md_Abdullah_All_Sourav
New Contributor

I have a mosaic raster of an agricultural area. In the mosaic raster, a specific agricultural field (field no. 5) looks just like this 

When I clip the raster with the field's shapefile (shapefile of the field no. 5) the color changes a bit and looks like the following image. 

The following codes have been used to clip the mosaic raster -

#clipping the raster
arcpy.Clip_management(in_raster= mosaic_pan_layer, rectangle=str(extent_of_shape_file),
out_raster=pan_save, in_template_dataset=shape_file, nodata_value="65536",
clipping_geometry="ClippingGeometry", maintain_clipping_extent="NO_MAINTAIN_EXTENT")

#saving the clipped raster
arcpy.CopyRaster_management (in_raster = pan_save, out_rasterdataset = Clipped_pan_save, nodata_value = "9999")

I also have done the following - 

- mosaic image > properties > symbology > save the statistics in xml . Then went to the symbology of the clipped result image > "rgb composite"> type = "custom" > statistics =  "from custom settings", and loaded the statistics using xml.

Here is the results - 

 

The result is - 

The mosaic image has some black portion where the pixel values are 0

Is there any way to get the clipped raster to look exactly the same as the mosaic layer?

Tags (3)
0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus

hmmmm sounds like you need to save the symbology from the original, then 

Apply Symbology From Layer—Data Management toolbox | ArcGIS Desktop 

0 Kudos
Md_Abdullah_All_Sourav
New Contributor

I tried that but applying symbology does not change anything. They still look different. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

If the range of values changed and the symbology doesn't then they would appear different since the range of colours would be different.  You want the coloration to stay the same which means it would not be dependent on the values but only the range.

0 Kudos
ModyBuchbinder
Esri Regular Contributor

The first thing is to make sure no values was changed. You do this by identify a few points when both rasters are visible and the identify option is visible layers.

Then you need to transfer the symbology. I found the easiest way to do it is to save lyr file from the original image and set the data source to the new one.

Have Fun

0 Kudos