A lightweight GeoTIFF viewer for quick visualization directly from the command line.
You can visualize single-band GeoTIFFs, RGB composites, HDF, NetCDF files and shapefile overlays in a simple Qt-based window.
pip install viewtifNote: Requires Python 3.10 or higher. On Linux, you may need python3-tk, libqt5gui5, or PySide6 dependencies.
viewtifrequires a graphical display environment.
It may not run properly on headless systems (e.g., HPC compute nodes or remote servers without X11 forwarding).
pip install "viewtif[geo]"Note: For macOS(zsh) users: Make sure to include the quotes, or zsh will interpret it as a pattern.
pip install "viewtif[netcdf]"Note: For enhanced geographic visualization with map projections, coastlines, and borders, install with cartopy:
pip install "viewtif[netcdf]"(cartopy is included in the netcdf extra). If cartopy is not available, netCDF files will still display with standard rendering.
GDAL is required to open .hdf, .h5, .hdf5, and .gdb files.
brew install gdal # macOS
sudo apt install gdal-bin python3-gdal # Linux
pip install GDAL# View a GeoTIFF
viewtif ECOSTRESS_LST.tif
# View an RGB composite
viewtif --rgbfiles \
HLS_B04.tif \
HLS_B03.tif \
HLS_B02.tif
# View an RGB composite from a multi-band file
viewtif rgb.tif --rgb 4 3 2
# View with shapefile overlay
viewtif ECOSTRESS_LST.tif \
--shapefile Zip_Codes.shp
# Change the color and width
viewtif ECOSTRESS_LST.tif \
--shapefile Zip_Codes.shp --shp-color red --shp-width 2viewtif can open .hdf, .h5, and .hdf5 files that contain multiple subdatasets. When opened, it lists available subdatasets and lets you view one by index. You can also specify a band to display (default is the first band) or change bands interactively with '[' and ']'.
# List subdatasets
viewtif AG100.v003.33.-107.0001.h5
# View a specific subdataset
viewtif AG100.v003.33.-107.0001.h5 --subset 1
# View a specific subdataset and band
viewtif AG100.v003.33.-107.0001.h5 --subset 1 --band 3Note: Some datasets (perhaps the majority of .hdf files) lack CRS information encoded, so shapefile overlays may not work. In that case, viewtif will display:
[WARN] raster lacks CRS/transform; cannot place overlays.
viewtif can now open raster datasets stored inside Esri File Geodatabases (.gdb). When you open a .gdb directly, viewtif will list available raster datasets first, then you can choose one to view.
# List available raster datasets
viewtif /path/to/geodatabase.gdb
# Open a specific raster
viewtif "OpenFileGDB:/path/to/geodatabase.gdb:RasterName"Note: If multiple raster datasets are present, viewtif lists them all and shows how to open each. The .gdb path and raster name must be separated by a colon (:).
As of v1.0.7, viewtif automatically checks the raster size before loading.
If the dataset is very large (e.g., >20 million pixels), it will pause and warn that loading may freeze your system.
You can proceed manually or rerun with the --scale option for a smaller, faster preview.
viewtif now supports NetCDF (.nc) files via xarray, with optional cartopy-based geographic visualization. Use [ / ] to move forward or backward through time steps, and press M to switch between the three built-in colormaps ("RdBu_r", "viridis", "magma").
--vmin [value] --vmax [value]let you set the display range (for all file types).--timestep [int]lets you jump directly to a chosen time slice.cartopy offlet you see raw NetCDF images.
viewtif data.nc
viewtif data.nc --vmin 280 --vmax 320
viewtif data.nc --timestep 100
viewtif data.nc --cartopy off| Key | Action |
|---|---|
+ / - or mouse / trackpad |
Zoom in / out |
Arrow keys or WASD |
Pan |
C / V |
Increase / decrease contrast |
G / H |
Increase / decrease gamma |
M |
Toggle colormap. Single-band: viridis/magma. NetCDF: RdBu_r/viridis/magma. |
[ / ] |
Previous / next band (or time step) |
R |
Reset view |
- Command-line driven GeoTIFF viewer.
- Supports single-band, RGB composite, HDF/HDF5 subdatasets, and NetCDF.
- Optional shapefile overlay for geographic context.
- Adjustable contrast, gamma, and colormap.
- Fast preview using rasterio and PySide6.
- ECOSTRESS_LST.tif
- Zip_Codes.shp and associated files
- HLS_B04.tif, HLS_B03.tif, HLS_B02.tif (RGB sample)
- AG100.v003.33.-107.0001.h5 (HDF5 file)
- tasmax_mon_ACCESS-CM2_ssp370_r1i1p1f1_gn_2021.nc
- tas_Amon_KIOST-ESM_ssp585_r1i1p1f1_gr1_201501-210012.nc
viewtif was inspired by the NASA JPL Thermal Viewer — Semi-Automated Georeferencer (GeoViewer v1.12) developed by Jake Longenecker (University of Miami Rosenstiel School of Marine, Atmospheric & Earth Science) while at the NASA Jet Propulsion Laboratory, California Institute of Technology, with inspiration from JPL’s ECOSTRESS geolocation batch workflow by Andrew Alamillo. The original GeoViewer was released under the MIT License (2025) and may be freely adapted with citation.
Longenecker, Jake; Lee, Christine; Hulley, Glynn; Cawse-Nicholson, Kerry; Gleason, Art; Otis, Dan; Galdamez, Ileana; Meiseles, Jacquelyn. GeoViewer v1.12: NASA JPL Thermal Viewer—Semi-Automated Georeferencer User Guide & Reference Manual. Jet Propulsion Laboratory, California Institute of Technology, 2025. PDF.
- @HarshShinde0 — added mouse-wheel and trackpad zoom support; added NetCDF support with @nkeikon
- @p-vdp — added File Geodatabase (.gdb) raster support
This project is released under the MIT License © 2025 Keiko Nomura.
If you find this tool useful, please consider supporting or acknowledging the author.