Skip to content

Latest commit

 

History

History
66 lines (38 loc) · 1.7 KB

readme.md

File metadata and controls

66 lines (38 loc) · 1.7 KB

Overview

Yet another piece of code that draws images in the terminal. Now written in C!

Bonus support for animated GIFs.


"Animated" GIF in the terminal

Colored background without ASCII characters

Alpha channel support

Usage

pterm FILE [-b] [-w output_width] [-h output_height] [-t file_type]
  • FILE: path to an RGB-convertible image file

  • -b: color 'background' instead of ASCII characters

  • -w: specify output width (mutually exclusive with -h)

  • -h: specify output height (mutually exclusive with -w)

  • -t: image format; relevant if the input image is piped via stdin

Supported image formats: JPEG, PNG, TGA, BMP, PSD, GIF, HDR, PIC, PNM (see details in stb_image.h)

Header

If you wish to include pterm in your project:

#define PTERM_IMPLEMENTATION

before including pterm.h to create the implementation.

Notes

Please don't judge the code, it's just an excercise to prevent me from completely forgetting how to C.

Setup

Linux

Clone & make. Of course you can use CMakeLists.txt as well but it's just there for future Windows support.

Windows

Not supported yet; not until I figure out how to convince a Windows terminal to recognize ANSI colors.

Dependencies

None (apart from a C compiler and make/CMake). Included external sources: