Looking for an open source tool to grow/shrink raster edge by n pixels. I noticed Grass has r.grow but hoping there might be a way to do it with GDAL, PostGIS or python library.
More information: I want to shrink it around the edge where I have data not the entire rectangular region. Consider this raster: