1. A computer-implemented method to determine a mask for an image, the method comprising: determining a spatial function for a detected feature depicted in the image, wherein the spatial function indicates pixels of the image relative to a feature boundary estimated from the detected feature; determining a respective color likelihood distribution for each region of a plurality of regions of the image based on one or more distributions of color values in each of the regions, wherein the regions include a feature region and a non-feature region; determining a confidence mask based on the spatial function and one or more of the color likelihood distributions, wherein the confidence mask indicates, for each of a plurality of pixels of the image, an associated confidence that the pixel is a feature pixel; and applying a modification to pixels in the image using the confidence mask.