imgcli

command module
v1.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

📷 imgcli

A simple tool written in Go that prints images to the command line and more.


🔧 Setup

Download and compile from sources:

go get github.com/branogarbo/imgcli

Install just the binary with Go:

go install github.com/branogarbo/imgcli@latest

Or get the pre-compiled binaries for your platform on the releases page

💻 CLI usage

imgcli

A simple tool written in Go that prints images to the command line and more.

Usage:
  imgcli [command]

Available Commands:
  help        Help about any command
  print       Prints output to the command line.
  save        Saves output image to a text file.

Flags:
  -h, --help      help for imgcli
  -v, --version   version for imgcli

Use "imgcli [command] --help" for more information about a command.
Command Usage:
Usage:
  imgcli [command] [flags]

Examples:
imgcli print --invert ./images/pic.jpg
imgcli save -w 200 -W https://url-to-some/image.jpg

Flags:
  -p, --ascii string   The pattern of ascii characters from least to greatest visibility (default " .,:(/*%&#@")
  -h, --help           help for save
  -i, --invert         Whether or not the the print will be inverted
  -m, --mode string    he mode the image will be printed in (default "ascii")
  -q, --quiet          Whether or not the save output is quiet
  -W, --web            Whether the source image is in the filesystem or fetched from the web
  -w, --width int      The number of characters in each row of the output (default 100)

Use "imgcli [command] --help" for more information about a command.

📁 Package Usage

Install the package:

go get github.com/branogarbo/imgcli/util
Example:
package main

import (
	"fmt"
	"log"

	ic "github.com/branogarbo/imgcli/util"
)

func main() {
	printConfig := ic.OutputConfig{
		Src:          "https://github.com/branogarbo/imgcli/blob/master/examples/images/portrait.jpg?raw=true",
		OutputMode:   "ascii",
		AsciiPattern: " .:-=+*#%@",
		OutputWidth:  200,
		IsUseWeb:     true,
	}

	printString, err := ic.OutputImage(printConfig)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(printString)
}

Documentation

Overview

Copyright © 2021 Brian Longmore branodev@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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