Skip to main content

Quick look geospatial viewer for iTerm2 and ANSI compatible terminals

Project description

viewinline

Downloads PyPI version Python version

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

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

Installation

Requires Python 3.9 or later.

pip install viewinline

Usage

viewinline path/to/file.tif
viewinline path/to/vector.geojson
viewinline R.tif G.tif B.tif                 # RGB composite
viewinline path/to/multiband.tif --rgb-bands 3,2,1
viewinline path/to/folder --gallery 4x3      # show image gallery (4x3 grid)
viewinline data.csv --describe               # show numeric summary
viewinline data.csv --hist                   # render inline histograms
viewinline data.csv --scatter X Y  # scatter plot

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)
  • PNG, JPEG (.png, .jpg, .jpeg)
  • Single-band or multi-band composites

Composite inputs

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

Vectors

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

CSV

  • Preview (--describe)
  • Histograms (--hist)
  • Scatter plots (--scatter x y [--marker dot|plus|x|square])

Gallery view

  • Display all images in a folder with --gallery 4x4

Available options

  --display DISPLAY     Resize only the displayed image (0.5=smaller, 2=bigger). Default: auto-fit to terminal.
  --ansi-size ANSI_SIZE
                        ANSI fallback resolution. 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 colormap to single-band rasters or vector coloring. Flag without value  'terrain'.
  --rgb-bands RGB_BANDS
                        Comma-separated band numbers for RGB display (e.g., '3,2,1'). Overrides default 1-3.
  --gallery [GRID]      Display all PNG/JPG/TIF images in a folder as thumbnails (e.g., 5x5 grid).
  --describe            Show numeric summary for CSV files (similar to pandas.describe). (default: False)
  --hist                Plot histograms for numeric columns in CSV. (default: False)
  --bins BINS           Number of bins for CSV histograms (used with --hist). (default: 20)
  --scatter X Y         Plot scatter of two numeric CSV columns (e.g. --scatter area_km2 year).
  --color-by COLOR_BY   Numeric column to color vector features by (optional).
  --width WIDTH         Line width for vector boundaries (default: 0.7)
  --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.3.tar.gz (12.5 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.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viewinline-0.1.3.tar.gz
  • Upload date:
  • Size: 12.5 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.3.tar.gz
Algorithm Hash digest
SHA256 8709ca2c837084414d2cc6c0d4de3852298eb07b5016d2e4e4f8fc8bb2984dbc
MD5 e45097f6de8326668b55873a3ece2e95
BLAKE2b-256 99577d0c583be2e6cd65ebc5fd1238cc778259660545a9f92dde83cc5bd89618

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viewinline-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f79de1755910f6b5e3dae6742d18c356e01736e7ae08f72eecb727bcaa4b1389
MD5 b893c44a80793b63c2e8d1253aa6bc2c
BLAKE2b-256 b552757b2eb7386ccc1c0ea28aea1c6534daa9d97db0f1f7ac42667258770152

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