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

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. enter image description here

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

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


this is a display issue.

The colours you see are the result of an automatic contrast enhancement of ArcGIS. When you clip the image, the statistics (min, miax, mean and STD of each spectral band) of the image change, so the contrast enhancement also changes.

If you wan the same colour, you can export as an xml the statistics of the first image, and apply them (with the same enhancement method) on the second image.

In practice, right click on the first image > properties > symbology, at the bottom you can save the statistics (if stats are not available, compute them in raster properties tools (or use "from current display extent"). Then go to the symbology of the second image. Select again "rgb composite", then "custom" type, statistics "from custom settings", and load your xml.

print screen of symbology options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.