renderer

package
v0.0.0-...-dfced06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package renderer provides image rendering for terminal output.

Index

Constants

This section is empty.

Variables

View Source
var FloydSteinberg = draw.FloydSteinberg

FloydSteinberg is the Floyd-Steinberg dithering algorithm.

Functions

func Render

func Render(img image.Image, width int, height int) string

Render renders an image to an ANSI string.

Types

type CliImage

type CliImage struct {
	// contains filtered or unexported fields
}

CliImage is the image renderer.

func New

func New() CliImage

New creates a new CliImage renderer.

func (CliImage) Dither

func (r CliImage) Dither(dither bool) CliImage

Dither sets whether to apply Floyd-Steinberg dithering.

func (CliImage) Height

func (r CliImage) Height(height int) CliImage

Height sets the output height in characters.

func (CliImage) IgnoreBlockSymbols

func (r CliImage) IgnoreBlockSymbols(fgOnly bool) CliImage

IgnoreBlockSymbols sets whether to use only half blocks.

func (CliImage) InvertColors

func (r CliImage) InvertColors(invertColors bool) CliImage

InvertColors sets whether to invert colors.

func (*CliImage) Render

func (r *CliImage) Render(img image.Image) string

Render renders the image to an ANSI-styled string.

func (CliImage) Scale

func (r CliImage) Scale(scale int) CliImage

Scale sets the scale factor for rendering.

func (CliImage) Symbol

func (r CliImage) Symbol(symbol blocks.Symbol) CliImage

Symbol sets the block symbol mode.

func (CliImage) Threshold

func (r CliImage) Threshold(threshold int) CliImage

Threshold sets the luminance threshold level.

func (CliImage) Width

func (r CliImage) Width(width int) CliImage

Width sets the output width in characters.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL