1. A computer-implemented method comprising: identifying a first plurality of pixels in a raster image as foreground pixels and a distinct second plurality of pixels in the raster image as background pixels, each of the foreground pixels and background pixels having a respective color value; solving for a color model of opacity using the color values of the foreground pixels and the color values of the background pixels; and determining an opacity value for a pixel in the raster image using the color model of opacity.