image-square-wizard
image-square-wizard
toolisw (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.
Features
- 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.
Prerequisites
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.
Build Steps
- 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
Installation
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.
Usage
Run isw input.jpg output.png or inspect options with isw --help or man isw.
License
MIT
More Projects
Explore other projects that might interest you
bitf
A tiny and robust library to manage bitflags / bitsets / optionsets in TypeScript & JavaScript
faviconize
🎆 Library and CLI responsible for generating favicons in all formats and providing easy way to integrate them into your application
good-typescript-library-template
Production ready minimal template for developing and releasing TypeScript libraries, including automated GitHub repository setup. And believe me, it is good.