Skip to main content

Quick look geospatial viewer for iTerm2 and ANSI compatible terminals

Project description

viewinline

Quick-look geospatial viewer for iTerm2.
Displays rasters and vectors directly in the terminal — no GUI, no temporary files.

This tool combines the core display logic of viewtif and viewgeom, but is non-interactive:
you can’t zoom, pan, or switch colormaps on the fly. Instead, you control everything through command-line options (e.g. --display, --color-by, --colormap).

viewinline path/to/file.tif
viewinline path/to/vector.geojson
viewinline R.tif G.tif B.tif   # RGB composite

It’s designed for iTerm2 on macOS, using its inline image protocol to render a preview.

Dependencies

Requires Python 3.9 or later and the following libraries:

pip install numpy pillow rasterio geopandas matplotlib pyogrio

Available options

--display DISPLAY       # resize the displayed image (0.5=smaller, 2=bigger). default: auto fit to terminal
--ansi-size ANSI_SIZE   # set resolution if you are viewing the ANSI preview (try 180x90 or 200x100)
--band BAND             # band number to display (single raster case). default: 1
--colormap [{viridis,inferno,magma,plasma,cividis,terrain,RdYlGn,coolwarm,Spectral,cubehelix,tab10,turbo}]
                        # apply a colormap to single band rasters or vector coloring
                        # flag without value uses 'terrain' by default
--color-by COLOR_BY     # select a numeric column to color vector features
--edgecolor EDGECOLOR   # edge color for vector outlines (hex or named color). default: #F6FF00
--layer LAYER           # layer name for GeoPackage or multi layer files

ANSI/ASCII color preview

If iTerm2 isn’t available, viewinline will automatically switch an ANSI/ASCII color preview or save a quick PNG under /tmp/viewinline_preview.png.

This mode works on terminals with ANSI color support and may not display correctly on others.
For compatible terminals, viewinline renders images in a very coarse resolution. This feature is experimental.

License

This project is released under the MIT License © 2025 Keiko Nomura If you find this tool useful, please consider supporting or acknowledging the author.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viewinline-0.1.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viewinline-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file viewinline-0.1.1.tar.gz.

File metadata

  • Download URL: viewinline-0.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for viewinline-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c01b8acab5901d2eeb4997e67bea713ec06e7ce52badc15ea92d2f849ebb814e
MD5 057757731f84a77afa03b6d0f83c3f12
BLAKE2b-256 ed24e90976f97bdbf9f3e99b863afb865e7778dd76301f7108b74fd4903578dc

See more details on using hashes here.

File details

Details for the file viewinline-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: viewinline-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for viewinline-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5eea949ec88e273efacb635fd54572b86e7e3ebb6680a92cff73721d51bbe2a4
MD5 3449082aaba7294d38a0469a1e97bc50
BLAKE2b-256 549dae204ead034664e54e51e176ccb06988081881a12b146253549d13080f3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page