Documentation
¶
Index ¶
- func BlackAndWhitePalette(c color.Color) color.Color
- func Burkes(x, y int, img *image.RGBA, err RGBAVec)
- func Dither(img image.Image, algo Algo, find ColorFinder) image.Image
- func FloydSteinberg(x, y int, img *image.RGBA, err RGBAVec)
- func Plan9Palette(c color.Color) color.Color
- func WebSafePalette(c color.Color) color.Color
- type Algo
- type ColorFinder
- type RGBAVec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlackAndWhitePalette ¶
BlackAndWhitePalette converts colors to either black or white. RGB values are converted into grayscale with: gray = (r + g + b) / 3 If gray is under 0x0FFF it is converted to black and otherwise to white.
func Burkes ¶
Burkes applies Burkes dithering to image. Should not be called directly and should be rather passed Dither function.
func Dither ¶
Dither applies given dithering algorithm to the image. Quantinization can be controlled by fjnd callback that should return closet color available.
func FloydSteinberg ¶
FloydSteinberg applies Floyd-Steinber dithering to image. Should not be called directly and should be rather passed Dither function.
func Plan9Palette ¶
Plan9Palette converts colors to the ones found in palette.Plan9
Types ¶
type ColorFinder ¶
ColorFinder specifies who to transform given color to suit the palette