1. A computer-implemented method, comprising: defining a plurality of piecewise-constant regional cost values including a foreground cost value, a background cost value, and a bias cost value; receiving user input defining a sample of pixels from an image defined by a raster of pixels; classifying pixels in the raster of pixels as being foreground or background based on the sample of pixels and the plurality of piecewise-constant regional cost values; and updating a rendering of the image on a display to depict classified foreground pixels and background pixels.