Documentation ¶
Index ¶
- func BasicSelection(options *OptionData, pixel []color.Color) (string, color.Color, color.Color)
- func File(out io.Writer, path string, options ...Option) error
- func FileString(path string, options ...Option) (string, error)
- func Image(out io.Writer, img image.Image, options ...Option) error
- func ImageString(img image.Image, options ...Option) (string, error)
- type Option
- func WithANSI() Option
- func WithANSI256() Option
- func WithBrightness(change float64) Option
- func WithColorPairMax(pairs int) Option
- func WithContrast(change float64) Option
- func WithCrop(x int, y int, width int, height int) Option
- func WithFlip(h bool, v bool) Option
- func WithFontScaling(scale float64) Option
- func WithGrayScale() Option
- func WithMaxRoutines(routines int) Option
- func WithMaxWidth(width int) Option
- func WithPattern(pattern ...[]charmaps.Pattern) Option
- func WithResize(width int, height int) Option
- func WithSaturation(change float64) Option
- func WithSharpen(times int) Option
- func WithTrueColor() Option
- type OptionData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicSelection ¶
BasicSelection finds the best character, foreground and background pair matching the 8x8 pixel grid.
func FileString ¶
FileString decodes the image from a file and builds a terminal printable image of it. Returns the ansi string.
Types ¶
type Option ¶
type Option func(data *OptionData)
func WithANSI ¶
func WithANSI() Option
WithANSI enables basic ansi color support. This is important if you don't output to os.Stdout and no terminal detection can be done or if you want to force a color mode.
func WithANSI256 ¶
func WithANSI256() Option
WithANSI256 enables 256 color support. This is important if you don't output to os.Stdout and no terminal detection can be done or if you want to force a color mode.
func WithBrightness ¶ added in v0.0.3
WithBrightness changes the brightness of the image.
func WithColorPairMax ¶
WithColorPairMax specifies how many color pair possibilities the algorithm will try per 8x8 pixel chunk. Lower value results in better performance but colors and selected symbols might be suboptimal. Values between 1 and 12 are sensible. Default is 6.
func WithContrast ¶ added in v0.0.3
WithContrast changes the contrast of the image.
func WithFontScaling ¶
WithFontScaling sets the vertical font scaling size, as most terminal fonts are taller than wider.
func WithGrayScale ¶ added in v0.0.3
func WithGrayScale() Option
WithGrayScale changes the image to grayscale.
func WithMaxRoutines ¶
WithMaxRoutines specifies how many go routines are allowed to be spawned for calculating the image.
func WithMaxWidth ¶
WithMaxWidth specifies a max width in cells for the output. This will keep the aspect ratio of the input picture and scale based on specified font ratio.
func WithPattern ¶
WithPattern specifies the character patterns that are usable in the algorithms. More patterns decrease the performance.
func WithResize ¶
func WithSaturation ¶ added in v0.0.3
WithSaturation changes the saturation of the image.
func WithSharpen ¶ added in v0.0.3
WithSharpen sharpens the images before conversion.
func WithTrueColor ¶
func WithTrueColor() Option
WithTrueColor enables true color support. This is important if you don't output to os.Stdout and no terminal detection can be done or if you want to force a color mode.
type OptionData ¶
type OptionData struct {
// contains filtered or unexported fields
}