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.0.tar.gz (6.9 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.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viewinline-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 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.0.tar.gz
Algorithm Hash digest
SHA256 96b0a5a61d7e85b5c10fca02288d9ed8425ad605f787bd669f4abc893c99cb93
MD5 8362189a3e81959fdd4775cede2409dc
BLAKE2b-256 b385c679b6eee065f05c9f30002cfa583dbd1f1dc02cc070023430e0b44d6dee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viewinline-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d4fbe7b541e06a38f7d5e02757501d868b54dc815812a826824f45c2486d9f6
MD5 619fc8bd775291cb68efb5133b404b52
BLAKE2b-256 19d46f20d305d9de1a511c1562bf15510c44f6b4615476be19ba05cc8e6aa8fd

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