An image that consists of indexes into a color palette. Use getAsTrueColorImage() if you don't care about palettes
An RGBA array of image data. Use the free function quantize() to convert to an IndexedImage
.
the opposite of moderate. Make darks darker and lights lighter
Finds the best match for pixel in palette (currently by checking for minimum euclidean distance in rgb colorspace)
Dithers img in place to look more like original.
Converts hsl to rgb
Converts hsl to rgb
.
Try to determine a text color - either white or black - based on the input
for light colors, call darken. for dark colors, call lighten. The goal: get toward center grey.
Move around the lightness wheel, trying not to break on moderate things
Converts true color to an indexed image. It uses palette as the starting point, adding entries until maxColors as needed. If palette is null, it creates a whole new palette.
Converts an RGB color into an HSL triplet. useWeightedLightness will try to get a better value for luminosity for the human eye, which is more sensitive to green than red and more to red than blue. If it is false, it just does average of the rgb.
This provides two image classes and a bunch of functions that work on them.
Represents an RGBA color