Skip to main content

bat_img

Fast, multithreaded batch image processor — available as a standalone command-line tool installable via pip.

The binary is a native Rust executable (no Python overhead at runtime). The Python package is simply a convenient delivery mechanism so you can install bat_img the same way you install any other command-line tool.

Installation

pip install bat_img

brew install libheif  # for HEIC/HEIF support

Pre-built binaries are provided for:

Platform Architecture
macOS Apple Silicon
Linux x86-64 (glibc 2.17+, compatible with most distros)
Windows x86-64

After installation, the bat_img command is available in your terminal.

Quick start

# Strip GPS location from all iPhone photos (in-place)
bat_img -i ~/Pictures/iPhone --strip-gps

# Resize all JPEGs to 1920 px wide, save to ./web/
bat_img -i ./photos -r 1920x0 -o ./web

# Strip ALL metadata, sharpen — 8 threads, recurse
bat_img -i ./raw -R --strip-all --sharpen -t 8 -o ./export

Features

Feature Flag
In-place processing — overwrite originals (omit --output)
Print image metadata (dimensions, size, format, date/time, etc.) --info
Strip GPS location from EXIF --strip-gps
Strip ALL metadata (EXIF, IPTC, XMP) --strip-all
Resize (width, height, or both) -r 1920x0
No-upscale guard --no-upscale
Resize filter --filter lanczos3
Add solid border --border 20 --border-color "#fff"
Rotate 90 / 180 / 270° --rotate 90
Flip horizontal / vertical --flip-h / --flip-v
Brightness adjustment --brightness 10
Contrast adjustment --contrast 15
Sharpen --sharpen
Grayscale --grayscale
JPEG / WebP quality -q 85
Filename prefix / suffix --prefix web_ --suffix _sm
Parallel threads -t 8
Dry-run preview --dry-run
Recursive directory walk -R

Usage

bat_img [OPTIONS] --input <INPUT>...

All options

  -i, --input <INPUT>...      Input: file path, glob pattern, or directory (e.g. ./photos, "*.jpg", ./img/photo.png)
  -o, --output <OUTPUT>       Output directory. When omitted, each input file is processed in-place (the original is overwritten)
  -R, --recursive             Recurse into subdirectories when input is a directory
      --info                  Print image metadata (dimensions, size, format, date/time, etc.)
      --strip-gps             Strip GPS location data from EXIF metadata
      --strip-all             Strip ALL EXIF/IPTC/XMP metadata (implies --strip-gps)
  -r, --resize <WxH>          Resize image. Format: WIDTHxHEIGHT (e.g. 1920x1080). Use 0 for auto (e.g. 1920x0 = fit width, 0x1080 = fit height)
      --filter <FILTER>       Resize filter algorithm [default: lanczos3] [possible values: nearest, triangle, catmull-rom, gaussian, lanczos3]
      --no-upscale            Do not upscale images smaller than the target size
      --border <PIXELS>       Add a border of N pixels on each side
      --border-color <COLOR>  Border color as CSS hex (#rrggbb) or name (white, black, red…) [default: white]
      --rotate <DEGREES>      Rotate image clockwise by degrees (90, 180, 270)
      --flip-h                Flip image horizontally (mirror left-right)
      --flip-v                Flip image vertically (mirror top-bottom)
      --brightness <VALUE>    Brightness adjustment (-100 to +100)
      --contrast <VALUE>      Contrast adjustment (-100 to +100)
      --sharpen               Apply sharpening filter
      --grayscale             Convert to grayscale
  -q, --quality <1-100>       JPEG/WebP output quality (1–100), required for non-HEIC output. Default is 90 if not set. HEIC file is encoded with the default encoder
      --suffix <SUFFIX>       Filename suffix appended before extension (e.g. "_edited" → photo_edited.jpg) [default: ""]
      --prefix <PREFIX>       Filename prefix prepended (e.g. "web_" → web_photo.jpg) [default: ""]
  -t, --threads <THREADS>     Number of threads to use (default: physical CPUs qty on macOS; logical CPUs qty on others) [default: 8]
      --overwrite             Overwrite existing output files (default: skip)
      --quiet                 Suppress all output except errors
      --dry-run               Dry-run: show what would be done without processing
  -h, --help                  Print help
  -V, --version               Print version

In-place mode

Omitting --output overwrites each original file in place. A temp file is written first and then atomically renamed over the original, so the source is never corrupted if something goes wrong.

# Show all image files meta data
bat_img -i ./photos --info

# Strip GPS from every HEIC file recursively — no copies made
bat_img -i ~/Pictures -R --strip-gps

# Resize all JPEGs to 2048 px wide, in-place
bat_img -i ./photos -r 2048x0

Examples

# Add a 20 px black border to all PNGs
bat_img -i ./screenshots --border 20 --border-color black -o ./bordered

# Rotate scans 90° clockwise and convert to grayscale
bat_img -i ./scans --rotate 90 --grayscale -o ./processed

# Dry-run — see what would happen without writing anything
bat_img -i ./photos -r 800x600 --strip-gps --dry-run

HEIC support

bat_img can read and write HEIC/HEIF files natively, including:

  • Decoding HEIC photos from iPhone / iPad
  • Re-encoding back to HEIC while preserving the original codec (HEVC / AV1) and file size (unless --quality is specified)

License

bat_img is distributed under MIT License. Please see details in LICENSE.

Metadata

Release files for bat-img 1.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bat-img 1.1.7
File Size Uploaded
bat_img-1.1.7.tar.gz 5.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bat-img 1.1.7
File Interpreter ABI Platform
bat_img-1.1.7-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
bat_img-1.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
bat_img-1.1.7-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 5.3 MB

Release files / bat_img-1.1.7.tar.gz

Download URL bat_img-1.1.7.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c90e7fd3dea9fd2c144c7a141216a5324637e661b4cc6bcdeb64c267da8e0752
BLAKE2b-256 checksum
How to use checksums
5c41684d59e76db88a52394c63f0ae8dc8739d8c90bf1dc1df4d00e2dce5a3eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / bat_img-1.1.7-py3-none-win_amd64.whl

Download URL bat_img-1.1.7-py3-none-win_amd64.whl
Size 2.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a0e2d910132ae2b3e12504b83849a8257427b35c922d00218b599e0154887d20
BLAKE2b-256 checksum
How to use checksums
24aa14a4d7fd34e2bcfadb99f5c5d7ff3dcf96a85146e94342ed23fa5b1b5a41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / bat_img-1.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bat_img-1.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
ae055539be71db464175c744de034cde293a2ee819d4767e6b649c0e7472c9fc
BLAKE2b-256 checksum
How to use checksums
b35e5fa671d11f4340dd2a2c289364b80dfecab7965af7399cc12e5adf5664a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / bat_img-1.1.7-py3-none-macosx_11_0_arm64.whl

Download URL bat_img-1.1.7-py3-none-macosx_11_0_arm64.whl
Size 1.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f10d7fc30184e2c5de4b88c4d09fd733f44d4f49dc763c646c9c1c1c1eac961f
BLAKE2b-256 checksum
How to use checksums
ecdfe46e3aecc9bfde46206e30a8c4a38b1dc3f64bf2e8ae24aa4f148ea3775d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.7 This release

4 release files

1.1.6

4 release files

1.1.5

4 release files

1.1.4

4 release files

1.1.3

4 release files

1.1.2

4 release files

1.1.1

4 release files

1.1.0

4 release files

1.0.9

4 release files

1.0.8

4 release files

1.0.7

4 release files

1.0.6

4 release files

1.0.5

4 release files

1.0.4

4 release files

1.0.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page