1. A method comprising: selecting, by a computing device, a pixel pair including a foreground pixel of an image and a background pixel of the image from a global set of pixels based at least on spatial distances from an unknown pixel and color distances from the unknown pixel; and determining, by the computing device, an opacity measure for the unknown pixel based at least on the selected pixel pair.