WIM - Web Image Maker
A command-line tool for creating and optimizing images for the web with text overlays, watermarks, and more.
Installation
pipx install wim
Or install from source:
git clone https://github.com/yaph/wim.git
cd wim
pip install -e .
Quick Start
# Add text overlay
wim input.jpg -t "Hello World"
# Add watermark
wim input.jpg -w logo.png
# Scale and add text
wim input.jpg -s 800 -t "Resized Image"
# Add semi-transparent watermark in top-right corner
wim photo.jpg -w logo.png --watermark-position top-right --watermark-opacity 128
Features
Text Overlays
- Add text with semi-transparent backgrounds
- Customize font, size, and position
- Automatic text centering and padding
Watermarks & Overlays
- Blend images over your photos
- Adjust opacity for subtle watermarks
- Scale overlays to any size
- Position overlays anywhere (corners, center)
Image Optimization
- Scale images to maximum dimensions
- Quantize to reduce file size
- Convert between formats (PNG, JPEG)
- Automatic RGBA to RGB conversion for JPEG
Smart Defaults
- Non-destructive by default (adds
-wimto file name stems) - RGBA support with proper alpha blending
- High-quality image resampling
Usage Examples
# Add text with custom font and size
wim input.jpg -t "Caption" --font times.ttf --font-size 24
# Add watermark with 50% opacity in bottom-right
wim photo.jpg -w logo.png --watermark-opacity 128
# Scale watermark to specific size
wim photo.jpg -w logo.png --watermark-scale 150 150
# Multiple operations at once
wim input.jpg -s 1200 -t "Summer 2024" -w logo.png --watermark-position top-right
# Edit image in place
wim input.jpg -i -t "Updated"
# Reduce file size with quantization
wim input.png -q
Command Line Options
wim --help
usage: wim [-h] [-i | -o OUTDIR] [--strip] [--trim] [--version] [--format {gif,png,jpeg,ico,webp,jpg,bmp}]
[--output-label OUTPUT_LABEL] [--quality QUALITY] [--quantize QUANTIZE] [-s WIDTH HEIGHT]
[--font FONT] [--font-size FONT_SIZE] [-t TEXT] [-w WATERMARK]
[--watermark-opacity WATERMARK_OPACITY] [--watermark-scale WIDTH HEIGHT]
[--watermark-position {top-left,top-right,bottom-left,bottom-right,center}]
filename [filename ...]
Edit, optimize, and watermark images from the command line.
positional arguments:
filename Input image filename. Use wildcard to process multiple files.
options:
-h, --help show this help message and exit
-i, --inplace Edit the image in place (overwrites original).
-o OUTDIR, --outdir OUTDIR
Output directory for processed images.
--strip Strip image of all metadata.
--trim Trim uniform-color borders from image edges.
--version show program's version number and exit
--format {gif,png,jpeg,ico,webp,jpg,bmp}
Set the output format. If not set, original format is used.
--output-label OUTPUT_LABEL
Label to append to the output file name. Ignored if --inplace is used.
--quality QUALITY Output quality 1-100 (lower = smaller file). Works with JPEG and WebP.
--quantize QUANTIZE Quantize the image with the desired number of colors, <= 256.
-s WIDTH HEIGHT, --scale WIDTH HEIGHT
Set the maximum width and height as integer values.
--font FONT Font name (e.g., DejaVuSans, Arial) or path to TrueType font file (.ttf), requires font size setting.
Falls back to system default if not specified or found.
--font-size FONT_SIZE
Set the font size, requires font setting.
-t TEXT, --text TEXT Set the text to add to the image.
-w WATERMARK, --watermark WATERMARK
Path to watermark/overlay image to add to the image.
--watermark-opacity WATERMARK_OPACITY
Opacity of watermark 0-255 (default: 255).
--watermark-scale WIDTH HEIGHT
Scale watermark to WIDTH HEIGHT in pixels.
--watermark-position {top-left,top-right,bottom-left,bottom-right,center}
Position of watermark (default: bottom-right).
Requirements
- Python ≥ 3.10
- Pillow
Development
# Clone repository
git clone https://github.com/yaph/wim.git
cd wim
# Run in development mode
hatch shell wim-dev
# Run tests
hatch run qa
# Clean build artifacts
hatch run clean
License
MIT License - see LICENSE file for details
Author
Ramiro Gómez (@yaph)
Links
- Documentation: https://github.com/yaph/wim#readme
- Issues: https://github.com/yaph/wim/issues
- Source Code: https://github.com/yaph/wim
Metadata
Release files for wim 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wim-2.0.0.tar.gz | 16.4 kB | Without provenance | Details for wim-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wim-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for wim-2.0.0-py3-none-any.whl |
Total release size: 27.7 kB
Release files / wim-2.0.0.tar.gz
| Download URL | wim-2.0.0.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7546420ae97425879b11ac825ceed0b73f76de9b1a5613e08b5985982f340000
|
|
BLAKE2b-256 checksum How to use checksums |
cdd70eb6234f0c0bc54050b44bbdbf91c3c1d0de6f81327a166645a390750d9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.28.1
|
Release files / wim-2.0.0-py3-none-any.whl
| Download URL | wim-2.0.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49909b9cee271b572ef5608d3b6e4b96f45e5f354ee8ea0211841642d49b66f3
|
|
BLAKE2b-256 checksum How to use checksums |
36e29a760533953012a29604a02fe81fc3ed8ce079ec618cd7a3f114f8154ffe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.28.1
|
Security for wim 2.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.