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.

Features

  • Displays rasters and vectors directly in the terminal
  • Works with iTerm2 inline image protocol
  • Non interactive: everything is controlled through command line options

Supported formats

Rasters

  • GeoTIFF (.tif, .tiff)
  • Single band or multi band composites

Vectors

  • GeoJSON (.geojson)
  • Shapefile (.shp, .dbf, .shx)
  • GeoPackage (.gpkg)

Composite inputs

  • You can pass three rasters (e.g. R.tif G.tif B.tif) to create an RGB composite

Installation

Requires Python 3.9 or later.

pip install viewinline

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 to 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.2.tar.gz (7.4 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.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viewinline-0.1.2.tar.gz
  • Upload date:
  • Size: 7.4 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.2.tar.gz
Algorithm Hash digest
SHA256 6eb30b411b5a51151913351570e0b68dd56c24b139b4b929730ba68e50b7d2a6
MD5 103067363fa8f1f484885ed1d46fa552
BLAKE2b-256 27c4c1648b512830476152ed1a607faf93b08577aa170debe2df574017d033f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viewinline-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a78192797ab58744d53692af63a33ebebeb364ee0c0ce3a762740f1b186383c
MD5 a4748d6745f06d335f545b71aac9c895
BLAKE2b-256 3f2f74ce58b65275eaf0681f5072f20b84382ad1ade45249fef2acf49dc579bc

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