Crate termimage [] [src]

Display images in your terminal, kind of

DS3 SS example

Library doc

This library is used by termimage itself for all its function and is therefore contains all necessary functions.

Data flow

Options::parse()
|> guess_format()
|> load_image()
|> resize_image()
|> write_[no_]ansi()

Executable manpage

Exit values and possible errors:

1 - failed to guess the file's format
2 - failed to open the image file

SYNOPSIS

termimage [OPTIONS] <IMAGE>

DESCRIPTION

Show images in your terminal.

The images are automatically downscaled to the terminal's size and their colours are approximated to match the terminal's display colours.

With ANSI output this means a 3-bit colour resolution, with WinAPI - 4-bit.

With WinAPI output the output colours are acquired from the console itself, with ANSI output a sane default is assumed.

OPTIONS

<IMAGE>

Image to display, must end in a recognisable image format extension.

-s --size <size>

Output image resolution.

By default this is autodetected to match the output terminal's resolution,
but is required when outputting to a file.

Format: NxM

-f --force

By default the image's aspect ratio will be preserved when downscaling,
use this option to override that behaviour.

-a --ansi

Force ANSI output.

This really applies only on Windows, as there's no non-ANSI alternatives
on other platforms.

EXAMPLES

checksums [-s NxM] [-f] assets/image.png

Display assets/image.png in the terminal, optionally not preserving
the aspect ratio.

Modules

ops

Main functions doing actual work.

util

Module containing various utility functions.

Structs

Options

Representation of the application's all configurable values.

Enums

Outcome

Enum representing all possible values the application can fail.