1. A computer-implemented method comprising: receiving an image mask, the image mask identifying a first opacity value of pixels in a raster image, the first opacity value ranging between a value representing foreground and a value representing background, each pixel in the image having a color; identifying a first boundary pixel in the image; and determining a second opacity value for the first boundary pixel using a first local color model of opacity, the first local color model of opacity being determined based on the colors of the pixels in the image within a local neighborhood of the first boundary pixel.