Documentation
¶
Index ¶
- func Colors(src image.Image, k int) ([]byte, error)
- func Flip(src image.Image) ([]byte, error)
- func Magik(src image.Image) ([]byte, error)
- func Mirror(src image.Image) ([]byte, error)
- func Mosaic(src image.Image) ([]byte, error)
- func Pixelate(src image.Image, factor int) ([]byte, error)
- func Stringify(src image.Image) ([]byte, error)
- func Swirl(src image.Image) ([]byte, error)
- func Triangle(src image.Image) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Colors ¶
Colors returns a 500x100 PNG swatch of the k most dominant colors in src. Colors are quantized to 5 bits per channel, so visually-similar shades are grouped together before counting.
func Magik ¶
Magik applies a wavy "liquid" distortion to src by displacing each pixel according to two superimposed sinusoidal fields. Cheap approximation of content-aware liquid rescaling.
func Mosaic ¶
Mosaic replaces each mosaicTileSize×mosaicTileSize block of src with the block's average color, separated by a dark grout line on the right/bottom edge.
func Stringify ¶
Stringify approximates src as classic string art: nail points on a circle inscribed in the image, then a greedy loop adds the line whose path most reduces the residual "darkness needed" field.
Per-line sums and a pixel→line reverse index are cached so each iteration only updates the lines that share pixels with the selected line instead of rescanning every candidate. This keeps the inner loop O(line_length × avg lines-per-pixel) rather than O(numLines × line_length).
Types ¶
This section is empty.