image_conversions

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const MAX_VAL float32 = 65535

For each individual element of imgSet in ConvertToASCIISlice()

Variables

This section is empty.

Functions

func ConvertToAscii added in v1.2.0

func ConvertToAscii(imgSet [][]AsciiPixel, negative bool, colored bool, complex bool, customMap string) [][]AsciiChar

Converts the 2D AsciiPixel slice of image data (each instance representing each pixel of original image) to a 2D AsciiChar slice with each colored and simple string having an ASCII character corresponding to the original grayscale and RGB values in AsciiPixel.

If complex parameter is true, values are compared to 69 levels of color density in ASCII characters. Otherwise, values are compared to 10 levels of color density in ASCII characters.

func ConvertToAsciiPixels added in v1.2.0

func ConvertToAsciiPixels(img image.Image, dimensions []int, flipX, flipY bool) ([][]AsciiPixel, int, int, error)

This function shrinks the passed image according to passed dimensions or terminal size if none are passed. Stores each pixel's grayscale and RGB values in an AsciiPixel instance to simplify getting numeric data for ASCII character comparison.

The returned 2D AsciiPixel slice contains each corresponding pixel's values. Grayscale value ranges from 0 to 65535, while RGB values are separate.

Types

type AsciiChar added in v1.2.0

type AsciiChar struct {
	Colored  string
	Simple   string
	RgbValue []uint32
}

type AsciiPixel added in v1.2.0

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

Jump to

Keyboard shortcuts

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