Copy Raster and Removing Black Borders

2496
4
11-20-2013 10:59 AM
BrianMaher
New Contributor
I have a number of MrSID files that I'm trying to convert to JPEG2000 format.  They have black borders around the edges of the imagery and I'm trying to remove them while converting. 

In the copy_management geoprocessing tool, there are two options to help do this.  Ignore Background Value seems like what I want, but it doesn't seem to work without providing a NoData Value.  I don't want to use the NoData value because there are black pixels in the imagery that I don't want to set to NoData. 

Is there anyway around this to remove just the black borders on the imagery without affecting the actual pixels in the image -- either through the Copy Raster geoprocessing tool or another geoprocessing tool?
0 Kudos
4 Replies
DuncanHornby
MVP Frequent Contributor
Sounds like you want to "extract by mask", you create another raster (or polygon) and crop back to that, so everything outside the polygon\raster mask is lost. This will change the extent of you image raster.
0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor
check the values in the image versus those in the border, it is quite possible that the black that you see doesn't have the same value and unlikely that areas within the image are nodata whereas those around the periphery are
0 Kudos
BrianMaher
New Contributor
Sounds like you want to "extract by mask", you create another raster (or polygon) and crop back to that, so everything outside the polygon\raster mask is lost. This will change the extent of you image raster.


Appreciate the response, but I'm trying to make this usable for any MrSID I come across.  Is there any way to do this without having to manually create a mask for each image?
0 Kudos
BrianMaher
New Contributor
check the values in the image versus those in the border, it is quite possible that the black that you see doesn't have the same value and unlikely that areas within the image are nodata whereas those around the periphery are


I checked and they both have RGB values of 0,0,0.
0 Kudos