Crates.io | imgcatr |
lib.rs | imgcatr |
version | 0.1.4 |
source | src |
created_at | 2024-01-04 05:15:56.363348 |
updated_at | 2024-01-04 10:58:55.686283 |
description | Cat for images |
homepage | |
repository | https://github.com/SilinMeng0510/imgcatr |
max_upload_size | |
id | 1088169 |
size | 1,058,987 |
A rust-based command-line command imgcatr
to display images.
Install from Crate.io, it's required to have Cargo on your computer.
cargo install imgcatr
brew install imgcatr
After installing the command on your computer's bin directory, you can directly call imgcatr
on CLI with the following instructions to display your images.
Usage: imgcatr [OPTIONS] <IMAGE>
Arguments:
<IMAGE> Image file to display
Options:
-s, --size <NxM> Image size to display [default: 138x22]
-f, --force Don't preserve the image's aspect ratio
-a, --ansi <ANSI> Force output ANSI escape [possible values: truecolor, simple-black, simple-white, ascii]
-h, --help Print help
-V, --version Print version
There are some features that you can customize how you would like to display the image. You can follow my documentation below to get more information on this command.
With the preparation of the image, you can specify the output format with -a
or -ansi
, where Imgcatr has 4 available output formats: truecolor
, simple-black
, simple-white
, ascii
, and no_ansi
(For Windows OS).
The default size of the image display is set to the size of the CLI. This means that the height of your image will not go beyond the height of your terminal.
However, you can specify the image size with -s
or -size
followed by input in <NxM>
format. An example is provided below, where the image size is set to 100x100.
imgcatr cat.png --size 100x100
The image ratio is preserved as default. And option -f
or -force
can force the program to not preserve the image ratio.
This work is derived from an open-sourced project named termimage
. Here, I'm offering my special thanks to the team.
The previous work termimage
uses an older version of the clap-v2 crate(library). imgcatr
replaces clap-v2 with the latest implementation of clap-v4, which has better performance overall.
In addition, imgcatr
offers a new feature in which users can display the ASCII format of images.
There will be potential improvement in future work with faster API and more features available.