pixelview

package module
v0.0.0-...-398f1e0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: ISC Imports: 6 Imported by: 1

README

pixelview

GoDoc Build Status Coverage Status Go Report Card

pixelview is a simple package which converts images to text formatted for tview (https://github.com/rivo/tview)

Documentation

Overview

Package pixelview is a simple package which converts images to text formatted for tview. It uses coloured unicode half-block characters (▀) to represent pixels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromFile

func FromFile(filename string) (encoded string, err error)

FromFile is a convenience function that converts a file on disk to a formatted string. See FromImage() for more details.

func FromImage

func FromImage(img image.Image) (encoded string, err error)

FromImage is the primary function of this package, It takes an image.Image and converts it to a string formatted for tview. The unicode half-block character (▀) with a fg & bg colour set will represent pixels in the returned string. Because each character represents two pixels, it is not possible to convert an image if its height is uneven. Attempts to do so will return an error.

func FromReader

func FromReader(reader io.Reader) (encoded string, err error)

FromReader is a convenience function that converts an io.Reader to a formatted string. See FromImage() for more details.

Types

This section is empty.

Jump to

Keyboard shortcuts

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