HOW TO

Remove the background of imagery layers in Portal for ArcGIS

Last Published: September 20, 2024

Summary

In some cases, there is no direct way to remove the background of an imagery layer in Portal for ArcGIS, which can obscure other details displayed on a map, as shown in the next image.

However, there are ways to remove the background by adding a raster function template to the imagery layer from the item details page, or while publishing the imagery layer from the Portal home.

Raster image with black background.

 

 

Procedure

There are two options described here to remove the background from an image layer, from within Portal for ArcGIS or ArcGIS Pro.

Portal for ArcGIS: Add the imagery as Image Collection and Define the No Data Value in the Processing tab

  1. Sign in to the Portal Home, and go to My Content > New Item.
  2. Click Add New item > Imagery Layer, and select Image Collection from the available options.
  3. Choose the Raster Type that best describes your imagery, click Configure Properties.
  4. On the Processing tab, select the option Define a pixel value that represents NoData, and set the NoData pixel Value to the background pixel value, as shown in the next image.
  5. Click Apply.

En Yeap_1.jpg

  1. Proceed to browse to the Imagery layer  > Proceed to Next.
  2. In the Select input imagery window, you can either use the Browse button to browse to the input data, or drag files into the dotted area.
    • If your data is on your local machine, click the From local tab and drag your local imagery files into the dotted area or browse to the input data. 
  3. Once completed, open in Map Viewer and see if the background was successfully removed . 
Note:
This option sets the background values as NoData and also may set valid pixel values from the image to NoData if they are the same value as the background pixels.

ArcGIS Pro: Adding a raster function template created in ArcGIS Pro to the imagery layer from the item details page

  1. Open ArcGIS Pro Project. On the Imagery tab, select Raster Functions, and search for and open the Mask function.
  2. Under NoData interpretation, select Match Any, and under NoData Values specify 0 for each band, as shown in the next image.
Note:
Don't use the Included Ranges option (remove by clicking on ID number). 
In the example below, we have set the NoData Values to 0 to match the background pixel value in the image layer.
  1. Save as the Raster Function by clicking Create New Layer, as shown in the next image. Click Save As.

Create a Raster Function.jpg

  1. In the Save As dialog, specify the Name and Description for the template, and either accept the defaults, or enter the remaining information and click OK.

Create a Raster Function_2.jpg

Note:
The xml file will be saved in the ArcGIS Pro Project folder.
  1. Add the newly created raster function template to the Portal, as shown in the next image. Go to Portal Home > Content > Add Item. Choose the raster functions xml file saved previously.

Create a Raster Function_3.jpg

  1. Open the Imagery layer (hosted) item details page. Go to the Settings tab, and click Choose Raster Function Template, shown in the next image. Select the newly added raster function to the portal.
  2. Set the Default template option to the newly added raster function, set Raster Functions as the newly added raster function, and click Save.
  3. Allow the portal some time for the image to process.

Add_Raster FunctionToPortal.jpg

  1. Once complete, proceed to view in Map Viewer to verify the output, as shown in the next image.

Raster image without background.

Article ID: 000031542

Software:
  • ArcGIS Pro
  • Portal for ArcGIS

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options