gitwtfhub

wtf is primage?

imfing/primage — explained in plain English

Analysis updated 2026-05-18

7RustAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

A fast Rust command-line tool for compressing, converting, and resizing images like JPEG, PNG, WebP, and AVIF.

Mindmap

mindmap
  root((primage))
    What it does
      Compresses images
      Converts formats
      Resizes and rotates
    Tech stack
      Rust
      MozJPEG and OxiPNG
      libwebp and ravif
    Use cases
      Bulk photo compression
      Convert PNG to WebP
      Terminal image preview
    Audience
      Developers
      Web performance folks
      CLI power users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Bulk compress a folder of JPEG photos to shrink file sizes for a website.

REASON 2

Convert PNG images to WebP or AVIF for smaller, modern web assets.

REASON 3

Resize and rotate images to exact dimensions as part of a build script.

REASON 4

Preview an image or compression result directly in a supported terminal.

What's in the stack?

RustMozJPEGOxiPNGlibwebpravif

How it stacks up

imfing/primagebrowsersync/bslivecodeitlikemiley/snip-cli
Stars777
LanguageRustRustRust
Last pushed2026-07-192024-12-09
MaintenanceActiveStale
Setup difficultyeasyhardeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright and license notices.

Wtf does this do

Primage is a command line tool for compressing, converting, and resizing images, built in Rust and designed to be fast. It supports the most common web image formats: JPEG, PNG, WebP, AVIF, and QOI, and it can read a wider range of formats, including GIF, TIFF, BMP, and a few others, before converting them out. The author describes it as bringing the same kind of workflow found in the browser tool Squoosh into a scriptable terminal command. Typical use is a single command per image: pointing primage at a photo along with a target format and quality setting produces a compressed or converted copy, and the tool prints how much smaller the result is. It can also resize images to an exact width or height, shrink them so the longest side fits within a limit, rotate them, and respects the orientation stored in a photo's EXIF metadata before applying any of those transforms. Because it accepts multiple input files, or a glob pattern like all JPGs in a folder, it works well for bulk jobs, and it processes batches in parallel across available CPU cores to keep things fast. One notable feature is the ability to preview images directly inside a compatible terminal, using the Kitty graphics protocol supported by terminals like Ghostty, kitty, WezTerm, and Konsole. This lets you see either the original image or what a specific compression setting will actually produce, without opening a separate image viewer. Under the hood, primage relies on established encoding libraries for each format, such as MozJPEG for JPEG, OxiPNG for PNG, libwebp for WebP, and ravif for AVIF, and release binaries bundle those libraries in so they run on a new machine without extra installation. It can be installed through Homebrew or Cargo, or downloaded as a prebuilt binary for macOS, Linux, or Windows. The project is licensed under the Apache License 2.0 and is still adding features, with JPEG XL decoding, AVIF decoding, and palette based color reduction listed as planned but not yet implemented.

Yoink these prompts

Prompt 1
Show me the primage command to convert a folder of PNGs to WebP at quality 75.
Prompt 2
Explain how to install primage and compress a single JPEG down to a target file size.
Prompt 3
Help me write a script that bulk-resizes images with primage to a max width of 1920 pixels.
Prompt 4
What's the difference between primage's lossy and lossless WebP output, and when should I use each?

Frequently asked questions

wtf is primage?

A fast Rust command-line tool for compressing, converting, and resizing images like JPEG, PNG, WebP, and AVIF.

What language is primage written in?

Mainly Rust. The stack also includes Rust, MozJPEG, OxiPNG.

What license does primage use?

Use freely for any purpose, including commercial use, as long as you keep the copyright and license notices.

How hard is primage to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is primage for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.