I can drag a JPG image onto a map in ArcGIS Pro, and then right-click on it in the Contents pane, and chose Data > Export Raster. This brings up a tool that allows me to export the raster with coloration by selecting the "Use Renderer" and "Force RGB" options.
This works fine, but I would like to be able to access this functionality programmatically from C# or Python. Is there a way to do this? The "Export Raster" tool does not seem to be in the Geoprocessing toolbox.
The differences are discussed here
and copy raster, here
with other options covered in the Environments settings, such as
Cell Alignment, Cell Size, Compression, Current Workspace, Extent, Geographic Transformations, NoData, Output CONFIG Keyword, Output Coordinate System, Parallel Processing Factor, Pyramid, Raster Statistics, Resampling Method, Scratch Workspace, Snap Raster, Tile Size
have you tried copy raster with settings for the particular environments using arcpy (eg those that are associated with cell size, renderer etc)
Thanks. The Copy Raster geoprocessing tool is a good start, but it only creates colored output if the raster was an image (e.g. jpg). If the raster is a grid then the rendered color map is not being exported to the image - it just comes out as all white, or in black and white. I need access the "Use Renderer" option which only seems to be available in the Export Raster tool...
try *.tif as outputs... it is esri's preferred raster format for most geoprocessing operations.
And I do remember something fuzzy about histograms and statistics, defining nodata value explicitly in environments and not using stretch for symbology if you want to retain color... but that was earlier today
So try another raster format with your environment parameters set to what you want
I found a way to do this through the SDK, although it's a bit of a cludge... You need to zoom to the raster layer you want to export, turn off all other layers and then call MapView.Active.Export() with an ExportFormat object as the input argument. For example a TIFFFormat object.