No description
Find a file
2023-07-12 19:26:44 +03:00
logo Added pattern editing, added black and white mode, fixed RangeDefect bug, removed useless stuff from utils; + README update 2022-04-30 23:49:06 +03:00
src Pixel type addded, unicode bug fixed, README documentation 2023-07-12 17:15:12 +03:00
imgcat.nimble Pixel type addded, unicode bug fixed, README documentation 2023-07-12 17:15:12 +03:00
LICENSE Create LICENSE 2020-11-05 19:53:35 +03:00
nim.cfg Auto image resizing, CLI updates 2021-06-07 15:52:11 +03:00
README.md README.md: +Installation 2023-07-12 19:26:44 +03:00

imgcat

This utility prints pictures in your console


Installation

You can install it via nimble:

$ nimble install imgcat

Usage

To print an image write:

$ imgcat <IMAGENAME>

To get help write:

$ imgcat --help

Utils

You can also use imgcat as a Nim library:

import imgcatpkg/utils

echo $imgcat("imagename.png",
            pattern="NIM",
            width=0,
            height=0,
            black_and_white=false,
            transparency=false)

Pixel type:

type
  PixelKind* = enum
    rgbPixel,
    bwpixel,
    transparentPixel,
    newLine
  Pixel* = object
    case kind*: PixelKind
      of rgbPixel:
        r*: uint8
        g*: uint8
        b*: uint8
        rgbPattern*: string
      of bwPixel:
        black*: bool
        bwPattern*: string
      of transparentPixel:
        discard
      of newLine:
        discard

imgcat proc:

proc imgcat*(imagename: string;
             pattern="█";
             width=(-1);
             height=(-1);
             black_and_white=false;
             transparency=false): seq[Pixel]

$ operators

proc `$`*(pixel: Pixel): string
proc `$`*(pixels: seq[Pixel]): string

Gallery

Icon made by Freepik from www.flaticon.com