The Border command creates
a soft-edged, anti-aliased selection border. When you add the new
selection border, only pixels between the two selection borders are
selected.

Using the Border command to create a 4-pixel border selection
(top). Copying the selection to a new layer and filling to make
an outline of the image (center). Filling the selection into the
original image to create an outline around the image (bottom).