Skip to main content

A Python clone of the classic Unix xv image viewer

Project description

pxv

A simple image viewer and manipulator built with Python/Pillow/Tkinter that takes inspiration from the classic Unix xv image viewer.

Quickstart

Run directly from the GitHub repo (requires uv):

uvx --from git+https://github.com/linsomniac/pxv pxv photo.jpg

Or install locally:

uv pip install git+https://github.com/linsomniac/pxv
pxv photo.jpg

Pass files, directories, or nothing (opens a file dialog):

pxv image.png              # single file
pxv *.jpg                  # multiple files
pxv ~/Photos/              # all images in a directory
pxv                        # open file dialog

Debian / Ubuntu (.deb)

Each GitHub release includes a pxv_<version>_all.deb. Install it (apt pulls in python3-tk and Pillow):

sudo apt install ./pxv_1.0.1_all.deb

It targets current distributions (Debian 13 / Ubuntu 24.04 or newer, which ship Pillow ≥ 10). After installing, pxv is on your PATH and appears in the applications menu and image "Open with" lists.

NixOS / Nix (flake)

Run it without installing:

nix run github:linsomniac/pxv -- photo.jpg

Install into your profile:

nix profile install github:linsomniac/pxv

Add to a NixOS configuration via the overlay (this also installs the .desktop entry and icon, so pxv appears in launchers and "Open with" menus):

{
  inputs.pxv.url = "github:linsomniac/pxv";

  # in your configuration.nix / module:
  nixpkgs.overlays = [ inputs.pxv.overlays.default ];
  environment.systemPackages = [ pkgs.pxv ];
}

Without flakes, nix-build produces the package from a checkout (uses default.nix).

Keyboard Shortcuts

Key Action
? Show keyboard shortcuts help
> Double zoom
< Halve zoom
. Increase zoom 10%
, Reduce zoom 10%
n Zoom to 1:1 (normal)
M Zoom to fill display
Space / Right Next image
Backspace / Left Previous image
b Browse thumbnails (Visual Schnauzer)
c Crop to selection
A Autocrop background borders
u Uncrop (undo last crop)
t Rotate clockwise
T Rotate counterclockwise
D Toggle dark/light background
f / F11 Toggle fullscreen
s Toggle slideshow
+ / - Slideshow interval +/- 1s
e Enhancement dialog
i Show image info / EXIF
Ctrl+s Save as
Escape Exit slideshow/fullscreen, or clear selection
q Quit

Right-click for additional options: rotate, flip, resize, grab (screenshot), print, and more.

Enhancements

The enhancement dialog (e) provides real-time adjustment with a live histogram (luminance + RGB overlays, log scale, clipping readouts) that tracks every change:

  • Sliders — brightness, contrast, gamma, sharpen, blur, saturation, hue rotation, per-channel RGB balance
  • Levels — black/gamma/white input markers over the channel histogram, output range, Auto (percentile clip), and black/gray/white eyedroppers that sample the image
  • Curves — spline curve editor per channel (master + R/G/B) with histogram backdrop, editable histogram Equalize, and Invert — the classic xv intensity and RGB graphs, modernized

Compare (hold) flips between the original and adjusted image; Apply bakes the adjustments into the working image (undoable with u/Ctrl+Z).

Features

  • Histogram, levels, and curves in the enhancement dialog (beyond-xv: live histogram backdrop, eyedroppers, editable equalization)
  • XV-style window sizing: window grows/shrinks to fit the displayed image, capped at the current monitor's bounds
  • Multi-monitor aware: detects per-monitor geometry via xrandr so windows don't span displays
  • EXIF-aware orientation
  • Save-options dialog for JPEG/PNG/WebP/TIFF (quality, compression, lossless, keep-metadata)
  • Slideshow auto-advance (--slideshow[=SECS]) and fullscreen presentation mode (--fullscreen)
  • Rubber-band selection for cropping
  • Wrap-around file navigation
  • Supports PNG, JPEG, BMP, TIFF, GIF, WebP, PPM, PGM, PBM, ICO

Requirements

  • Python 3.10+
  • Tkinter (usually included with Python; on Debian/Ubuntu: sudo apt install python3-tk)
  • Pillow 10+

Development

git clone https://github.com/linsomniac/pxv
cd pxv
uv sync
uv run pxv test_images/

Lint and type-check:

uv run ruff check src/
uv run ruff format --check src/
uv run mypy src/pxv/

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

pxv-1.0.5.tar.gz (58.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pxv-1.0.5-py3-none-any.whl (69.4 kB view details)

Uploaded Python 3

File details

Details for the file pxv-1.0.5.tar.gz.

File metadata

  • Download URL: pxv-1.0.5.tar.gz
  • Upload date:
  • Size: 58.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pxv-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d967724d7aa3dddfcb14090ba94ff3984fd3c2af3b165053023358e7e3f355a5
MD5 27ccb870589d413d64f710e465460e49
BLAKE2b-256 fdfffa45df40cc83c5e7071b995de65cf4cc6a98ed40c75c08b196499ae48619

See more details on using hashes here.

Provenance

The following attestation bundles were made for pxv-1.0.5.tar.gz:

Publisher: release.yml on linsomniac/pxv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pxv-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: pxv-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pxv-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c6d382e69fdc5b3c8fd4030e16a2bf9a3d5dd88477e1db4eafa92ad5ec6d6151
MD5 1e95ada5657356736377d73e2c381654
BLAKE2b-256 650cfeab189dc870acc0c9ec56eb3aa65390b6dfba402aeeff90811f3491f393

See more details on using hashes here.

Provenance

The following attestation bundles were made for pxv-1.0.5-py3-none-any.whl:

Publisher: release.yml on linsomniac/pxv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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