🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

tildegit.org/sloum/pbmview.git

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tildegit.org/sloum/pbmview.git

v0.0.0-20210422031408-120d0dd63e2e
Go
Version published
Created
Source

pbmview

pbmview is a program, written in golang, to display netpbm images in a terminal. This likely exists as a part of the very large netpbm package many operating systems/distros make available in their repositories... but it was fun to work on.

At present pbmview supports: P1, P2, and P3 images (all of the human readable ASCII file types). Support may get added at a later point for types > P3 (binary types). The ascii types are fun to use to create little icons that can be used in shell scripts or the like. The fact that they are human readable make them a cool format for sharing over gopher/gemini as plain text. This formatting, being ascii based, will result in a larger image size than a jpg/png/etc in most cases, so if you decide to use it I recommend doing so for its ease of programming/scripting and for its ease of human readability.

Build and Use

If you have a golang compiler you should be able to compile the program (likely with go build or go install) and run it as follows:

pbmview [flags] [path to pbm/pgm/ppm]

The available flags are:

  • -fit - Will shrink the image to the terminal width. If the image width is already smaller than the terminal, it will just display it.
  • -scale [chars] - Will scale the image to a width equal to chars, where chars represents a pixel width in terminal characters.
  • -h - Print help text and exit

Examples netpbm images are provided in the examples folder (which contains its own readme for attribution purposes).

FAQs

Package last updated on 22 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts