imat is like cat for images in the terminal: open a raster file and view it right in your shell, using the terminal as the display.
Supported formats: JPEG (.jpg, .jpeg), PNG (.png), and TIFF (.tif, .tiff).
Requires Bun ≥ 1.0.
From Git (HTTPS) — installs the imat CLI globally:
bun i -g git+https://github.com/keejkrej/imat.gitFrom a clone of this repo (for development):
bun install
bun link --globalOmit bun link --global if you only want to run bun run src/imat.ts in that directory.
imat path/to/image.jpg
imat path/to/image.png
imat path/to/image.tifRun imat without a path to print usage (--shape, multipage TIFF notes, and key bindings). While viewing, use the on-screen shortcuts (e.g. arrow keys, r, Esc, q).
For stacks with more than one page, press r and enter a page grid: factors separated by x or , (row-major order into the page index). The product of the factors must be ≤ the number of pages.
Use 0 in exactly one position to infer that dimension: it becomes ⌊pages / (product of the other factors)⌋ so the full grid product is ≤ the page count (unlike PyTorch’s -1, which requires an exact fit). Only one 0 is allowed—no 0x0x3.
Examples: 24 pages — 3x8, 3x0 → 3×8. 25 pages — 3x0 → 3×8 (product 24; one page unused).