Photoshop

Defining undistorted areas

The Displace, Shear, and Wave filters in the Distort submenu and the Offset filter in the Other submenu let you treat areas undefined (or unprotected) by the filter in the following ways:

Wrap Around
Fills the undefined space with content from the opposite edge of the image.

Repeat Edge Pixels
Extends the colors of pixels along the edge of the image in the direction specified. Banding may result if the edge pixels are different colors.

Set To Background (Offset filter only)
Fills the selected area with the current background color.