Resize, crop, pad, and convert images from the command line.
One tiny binary Cross-platform Go MIT
Install GitHub
cmd: pixr photo.jpg thumb.webp -s 512x512 -m fit progress[1.8s arrow]: converting photo.jpg → thumb.webp success: wrote thumb.webp (512x512) delay[800]: note: pad to a square with a custom color, tuned quality cmd: pixr logo.png icon.png -s 256x256 -m fit -p "#0d1117" -q 90 progress[1.2s arrow]: converting logo.png → icon.png success: wrote icon.png (256x256)

Why

Resizing one image shouldn't mean opening an editor or memorizing an ImageMagick incantation. pixr is a single cross-platform binary: point it at an input and an output, optionally give it a size and a mode, and it does the obvious thing — format conversion included, inferred from the output filename.

Three resize modes

fit keeps aspect ratio inside your box, fill keeps aspect ratio and crops the excess, stretch hits the exact dimensions. Padding color is yours to pick.

Format conversion built in

Read and write JPEG, PNG, GIF, BMP, TIFF, WebP, AVIF, ICO, and ICNS. Even reads HEIC/HEIF and JPEG XL straight off your phone or camera.

Zero ceremony

pixr input.jpg output.png just works. Sensible defaults (800×512, quality 85, fit mode) — override only what you need.

Install

Scoop (Windows)

scoop bucket add rocky https://github.com/i-rocky/scoop-bucket
scoop install pixr

Homebrew (macOS / Linux)

brew tap i-rocky/tap && brew install pixr

Manual

Grab a prebuilt binary from GitHub Releases — darwin, linux, and windows builds for x86_64 and aarch64 — and drop it on your PATH.

Usage

pixr -i input.jpg -o output.png -w 800 -H 600   # explicit flags
pixr -i input.jpg -o output.png -s 800x600      # combined size
pixr input.jpg output.png -w 800 -H 600         # positional input/output
pixr input.jpg output.png                       # defaults: 800x512, fit, q85
FlagWhat it doesDefault
-i, --inputinput image file (or first positional argument)—
-o, --outputoutput image file (or second positional argument)—
-w, --widthtarget width800
-H, --heighttarget height512
-s, --sizetarget size as WIDTHxHEIGHT (e.g. 512x512)—
-m, --moderesize mode: fit, fill, or stretchfit
-q, --qualityoutput quality for lossy formats (1–100)85
-f, --formatoutput format (jpg, png, gif, …)from output filename
-p, --pad-colorpadding color in hex (#RRGGBB)#FFFFFF
-?, --helpshow help—
--versionprint version—

Supported formats

FormatReadWrite
JPEG (.jpg, .jpeg)✅✅
PNG (.png)✅✅
GIF (.gif)✅✅
BMP (.bmp)✅✅
TIFF (.tiff, .tif)✅✅
WebP (.webp)✅✅
AVIF (.avif)✅✅
ICO (.ico)✅✅
ICNS (.icns)✅✅
HEIC/HEIF (.heic, .heif)✅read-only
JPEG XL (.jxl)✅read-only

HEIC/HEIF and JPEG XL sources can be read but must be written to a fully supported output format (PNG, JPEG, WebP, …) — the underlying decoders don't encode. JPEG 2000 (.jp2) is not supported in either direction.