1. A method comprising: compressing color values in a palette-based codec; finding clusters of color values having constant color values using said codec by using a clustering algorithm and by taking a first color from a palette, building a cluster around the first color and then, if a second color that is different by a threshold from the first color, forming a second cluster including the second color, and fitting ensuing colors into the first and second clusters; encoding, using said codec, color values within the cluster with respect to a color value having a predefined characteristic, wherein said pre-defined characteristic is a sample or pixel with the minimum color value within the cluster; encoding information to indicate that a color channel is constant; and encoding, in said codec, clusters that have pixels or samples with the constant color value.