MCPcopy Index your code
hub / github.com/SilinMeng0510/imgcatr

github.com/SilinMeng0510/imgcatr @v0.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.4 ↗ · + Follow
25 symbols 41 edges 7 files 13 documented · 52%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ImgCatr

Licence Crates.io version

A rust-based command-line command imgcatr to display images.

running <code>imgcatr cat.png</code>

Install

Crate.io

Install from Crate.io, it's required to have Cargo on your computer.

cargo install imgcatr

On MacOS

brew install imgcatr

Usage

Overview

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.

Display Format

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).

running <code>imgcatr cat.png</code>

Customized Size

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

Ratio Preserve

The image ratio is preserved as default. And option -f or -force can force the program to not preserve the image ratio.

running <code>imgcatr cat.png</code>

Comment

Special Thanks

This work is derived from an open-sourced project named termimage. Here, I'm offering my special thanks to the team.

Comparison

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.

The Future

There will be potential improvement in future work with faster API and more features available.

Core symbols most depended-on inside this repo

closest_colour
called by 2
src/util.rs
create_colourtable
called by 2
src/ops/mod.rs
write_ansi
called by 2
src/ops/mod.rs
actual_main
called by 1
src/main.rs
result_main
called by 1
src/main.rs
bg_colours_for
called by 1
src/util.rs
print_error
called by 1
src/error.rs
exit_value
called by 1
src/error.rs

Shape

Function 16
Method 6
Enum 2
Class 1

Languages

Rust100%

Modules by API surface

src/ops/mod.rs9 symbols
src/options.rs6 symbols
src/util.rs3 symbols
src/main.rs3 symbols
src/error.rs3 symbols
src/ops/no_ansi.rs1 symbols

For agents

$ claude mcp add imgcatr \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact