One embodiment of the present invention provides a system that deposterizes a posterized image. During operation, the system receives a posterized image, wherein pixels in the posterized image have color values that belong to a set of posterized color values, which is a subset of a set of possible color values for the deposterized image. Next, the system generates a deposterized image from the posterized image, wherein color values in the deposterized image are not restricted to the set of posterized color values and instead can be selected from the entire set of possible color values to reduce artifacts caused jumps in color values that arise from posterization. While generating the deposterized image, the system selects color values for pixels in the deposterized image so that the deposterized image can be reposterized to restore the original posterized image.