linear-expansion filter for image (2D array) I am working in python analyzing 2D arrays and I am looking for a filter or some other routine that would provide a linear expansion of an region boundaries in a 2D array with binary regions (i.e. a black/white image).  For example given this star image:



I would like to apply a filter that expands a region's borders with a  radial, linear decrease from a maximal value (i.e. black) to the surrounding value.   Graphically represented as:



So that the resulting image/array is something like:
Simply resize the binarized image to a larger image but do not use any high order interpolation in resizing and instead use 'nearest neighbor'interpolation technique. In MATLAB:

im2 = imresize(image, 10, 'nearest')


part of 10x expanded image:



and a raster of the image: