When using a geoprocessing tool, for example Hillshade, when you specify an extent in the environment settings, you might have noticed sometimes that your output raster is slightly larger than your specified extent. Ever wondered what is going on inside the box? Let’s find out what triggers that effect.
The Extent environment controls where the raster analysis occurs, which means that the tools that honor this environment will only process the raster cells that fall within the extent. When you specify an extent in the environment, the lower-left corner of the specified extent will automatically become the lower-left corner of the output raster, unless you have also specified a Snap Raster environment. From here, the upper-right corner of the output raster is adjusted in such a way that the specified extent falls within your output raster. Whether the upper-right corner will be adjusted or not is determined by the output cell size, and the width and the height of the output raster extent are multiples of the output cell size. The end result is that the extent of the actual output raster can be slightly larger than what you specified in the extent environment.
![](https://blogs.esri.com/esri/arcgis/files/2017/04/sapa_environment_extent.png)
Adjusted output raster extent
If the lower-left corner of the extent does not match with any cell corner of the input raster, it will create a shift in the cell alignment between the input and the output raster. This difference of cell alignment will trigger a resampling of the input raster to perform analysis. Most Spatial Analyst tools use a nearest neighbor resampling technique, except for the Surface tools, which use bilinear interpolation.
You can avoid getting this shift in cell alignment and resampling by specifying a Snap Raster to your input raster in the environment setting. To know more about Snap Raster, read How the Snap Raster environment setting works.