Select to view content in your preferred language

Mosaic to New Raster adds white background

919
4
10-24-2023 03:59 AM
JakubWabinski
Regular Contributor

Hey guys,

I am preparing a bigger script for spatial data processing using, inter alia, arcpy.

 Part of the script is supposed to mosaic the newly added raster datasets to a geodatabase. The original rasters have no background but after using the Mosaic to New Raster function, a white background is added. I know that this background can be masked out in the symbology pane but I would like to handle it using arcpy. Could you please suggest a solution?

JakubWabinski_0-1698145135766.png

Before mosaicing

JakubWabinski_1-1698145150635.png

After mosaicing

 

 

Tags (3)
4 Replies
MichaelS
Esri Contributor

Hi Jakob, It looks like the tool is assigning a background value  to your mosaic. You could try checking the value of the white background, then setting your no data value to that value in the Environments pane of the Mosaic to New Raster tool, re-run and see if that helps. 

MichaelS_1-1698150147972.png

 

 

-Enterprise Support Analyst
0 Kudos
JakubWabinski
Regular Contributor

Thanks for your answer. But the mosaic has 4  8-bit bands. What should I write there? 255 only or rather 255,255,255?

0 Kudos
MichaelS
Esri Contributor

Just 255 should be sufficient.

-Enterprise Support Analyst
0 Kudos
JakubWabinski
Regular Contributor

Still having the same issue. I tried with both: writing 255 and setting the parameter to 'maximum'. Any other ideas?

JakubWabinski_0-1698322205100.png

 

0 Kudos