isw.mp4
isw (image square wizard) pads rectangular or panoramic images to a square canvas using libvips. It
measures the dominant colour (or accepts a user-provided colour / transparent
fill) and expands the image evenly on each side.
- Fast. Built in C.
- JPEG, PNG, WebP, HEIF/HEIC, TIFF, AVIF support out of the box.
- Only one command. Specify input & output along with extensions and thats it.
- Automatic detection of aspect ratio.
- Probing of the dominant color of the image to be used for padding (by default).
- Customization options, e.g. provide your own colors.
libvips8.12 – 8.18 (tested with 8.17.2). Install via your package manager, e.g.brew install vipson macOS orapt install libvips-devon Debian/Ubuntu.- Meson (>= 1.1) and Ninja for the build.
- A C11 toolchain (e.g. clang or gcc) with pkg-config.
- Clone the repository:
git clone https://github.com/neg4n/image-square-wizard isw && cd isw - Configure the build directory:
meson setup build - Compile:
meson compile -C build
Run meson install -C build inside the repository's root in order to install the isw binary and man page. Adjust
DESTDIR or --prefix during meson setup if you need a custom location.
Run isw input.jpg output.png or inspect options with isw --help or man isw.
MIT