{"id":13586270,"url":"https://github.com/daleroberts/bv","last_synced_at":"2025-08-22T00:31:15.374Z","repository":{"id":37285370,"uuid":"69613876","full_name":"daleroberts/bv","owner":"daleroberts","description":"Quickly view satellite imagery, hyperspectral imagery, and machine learning image outputs directly in your iTerm2 terminal.","archived":false,"fork":false,"pushed_at":"2017-01-17T03:08:40.000Z","size":8091,"stargazers_count":228,"open_issues_count":1,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-10T06:21:50.358Z","etag":null,"topics":["command-line","computer-vision","image","iterm2","machine-learning","python","satellite","satellite-imagery"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daleroberts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-29T22:46:41.000Z","updated_at":"2024-10-03T02:54:14.000Z","dependencies_parsed_at":"2022-08-31T20:10:15.894Z","dependency_job_id":null,"html_url":"https://github.com/daleroberts/bv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fbv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fbv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fbv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fbv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daleroberts","download_url":"https://codeload.github.com/daleroberts/bv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230542288,"owners_count":18242332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","computer-vision","image","iterm2","machine-learning","python","satellite","satellite-imagery"],"created_at":"2024-08-01T15:05:26.345Z","updated_at":"2024-12-20T06:06:37.307Z","avatar_url":"https://github.com/daleroberts.png","language":"Python","funding_links":[],"categories":["Python","`Python` processing of optical imagery (non deep learning)","Visualization"],"sub_categories":["Processing imagery - post processing"],"readme":"\n**bv** is a small tool to quickly view high-resolution multi-band imagery\ndirectly in your [iTerm 2](https://www.iterm2.com). It was designed for\nvisualising very large images located on a remote machine over a low-bandwidth\nconnection. It subsamples and compresses the image sends it over the wire as a\nbase64-encoded PNG (hence the name \"bv\") that iTerm 2 inlines in your terminal.\n\n\u003cimg src=\"https://github.com/daleroberts/bv/raw/master/docs/trump.png\" width=\"800\"\u003e\n\nNow, go and compare the above to [old-school rendering](https://camo.githubusercontent.com/a6c791a0b4d97315d00b6592f918fe744abe00e6/687474703a2f2f692e696d6775722e636f6d2f556e666e704d722e706e67)\nor my other tool [tv](https://github.com/daleroberts/tv). Welcome to 2017!\n\n# Some Examples\n\nHere are a number of examples that show how this tool can be used.\n\n## Big image over small connection\n\nDisplay a 3.5 billion pixel single-band image (3.3GB) using only 467KB over a SSH connection.\n\n\u003cimg src=\"https://github.com/daleroberts/bv/raw/master/docs/bigimg.png\" width=\"800\"\u003e\n\n## Different band combinations\n\nDisplay a six-band image (7.2GB) using only 1.1MB over a SSH connection. Here,\nwe put bands 5-4-3 into the RGB channels using `-b 5 -b 4 -b 3` (ordering\nmatters) and set the width of the output image to be 600 pixels using `-w 600`.\n\n\u003cimg src=\"https://github.com/daleroberts/bv/raw/master/docs/bands.png\" width=\"800\"\u003e\n\nYou can also specify a single band to display (e.g., `-b 1`).\n\n## Subset images\n\nYou can subset images using `gdal_translate` syntax which is `-srcwin xoff yoff\nxsize ysize`. For example, only displaying a small 1000x1000 area of the same large image above.\n\n\u003cimg src=\"https://github.com/daleroberts/bv/raw/master/docs/subset.png\" width=\"800\"\u003e\n\nThis allows you to quickly identify regions of your image and then paste the same options \ninto `gdal_translate` to complete your desired workflow. For example:\n```\nremote$ gdal_translate tasmania-2014.tif -b 5 -b 4 -b 3 -srcwin 12000 11000 1000 1000 -of PNG -ot UInt16 -scale 0 4000 ~/out.png\nInput file size is 20000, 16000\n0...10...20...30...40...50...60...70...80...90...100 - done.\nremote$\n```\n\n## Machine learning multi-class outputs with different color maps\n\nSometimes you might have a single-band image that only contains classes\n(integers). Different color maps can be applied to these single-band images\nusing the `-cm` option and any choice from [matplotlib's\ncolormaps](http://matplotlib.org/examples/color/colormaps_reference.html).\n\n\u003cimg src=\"https://github.com/daleroberts/bv/raw/master/docs/colors.png\" width=\"800\"\u003e\n\n## URLs\n\nThe **bv** tool can read from URLs (see the Trump image above). It can also\nparse URLs on `stdin`, this allows you to [do\nthings](https://github.com/developmentseed/landsat-util) like this to quicky\ndisplay available Landsat images roughly over Dubai.\n\n```\nremote$ landsat search --lat 25 --lon 55 --latest 3 | bv -urls -\n```\n\n## Standard Input\n\nFilenames can be read from `stdin`. For example:\n```\nls -1 *.tif | bv -w 100 -\n```\n\n## Compression\n\nThe level of compression can be changed using the `-zlevel` option (0-9).\n\n## Stacking images\n\nIf your bands are located in seperate images then you can stack them and display them\nin the RGB channels using\n```\nbv -stack RED.tif GREEN.tif BLUE.tif\n```\n\nThere is also the `-revstack` option to do it in reverse order.\n\n## Subsampling algorithm\n\nThe subsampling algorithm can be changed using the `-r` option (same syntax as GDAL). The available subsamplings are:\n- Nearest\n- Average\n- Cubic Spline\n- Cubic\n- Mode\n- Lanczos\n- Bilinear\n\n## Alpha channel\n\nFor single-band images, you can specify the color value to set as the alpha\nchannel. This is sometimes useful for machine learning outputs where you want\nto not display certain classes. You can add multiple of these with different\nvalues.\n\n## PDF, EPS, and PNG\n\nThe **bv** tool will display PDF, EPS, and PNG output inline with out any\nchanges to those files. If you want to disable this behaviour you can pass the\n`-nop` option allow GDAL to subsample, etc.\n\n## TMUX Support\n\n\u003cimg src=\"https://github.com/daleroberts/bv/raw/master/docs/tmux.png\" width=\"800\"\u003e\n\n# Configuration\n\nYou can save your default configuration by setting an alias in your `~/.profile` file. For example, I do:\n```\nalias bv='bv -w 800'\n```\n\n# Installation\n\nIt is just a single-file script so all you'll need to do it put it in your\n`PATH`. Dependencies are Python 3, GDAL 2, Numpy, Matplotlib, and iTerm 2. I've\nfound that the best way to install these dependencies are: \n```bash\n# Python 3\nbrew install python3\n\n# Numpy and matplotlib\npip3 install numpy matplotlib\n\n# GDAL 2\nbrew install gdal --HEAD --without-python\npip3 install gdal\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaleroberts%2Fbv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaleroberts%2Fbv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaleroberts%2Fbv/lists"}