A fast command-line image resizing and conversion tool written in D.
- Resize images by dimensions (e.g., 512x512) or scale factor (e.g., 0.5)
- Convert between formats: PNG, JPEG, BMP, TGA, GIF, QOI, QOIX, DDS, SQZ
- Resizing using using
stb_image_resize2 - Alpha channel control - keep or remove transparency
You need to install D compiler toolchain to build this project. Ensure you also have dub package manager installed on your system. It usually comes with the compiler, but sometimes you may need to install it separately on Linux.
# clone the repository
git clone https://github.com/rillki/imgresize.git
cd imgresize
# build the project
dub build --build=releaseThe executable will be saved in ./bin folder.
Usage: imgresize --path <file> --format <fmt> [--size <WxH> --output <file>]
-p --path Required: Path to input image.
-f --format Required: Output format (png, jpeg, bmp...).
-s --size Target size or ratio (e.g. 256x256 or 0.8). Defaults to original image size.
-o --output Output image path. Defaults to 'path'.
-r --remove-alpha Remove alpha channel. Defaults to 'false'.
-h --help This help information.imgresize --path photo.jpg --size 800x600 --format pngimgresize --path photo.jpg --size 800x --format pngimgresize --path image.png --size 0.5 --format jpegimgresize --path photo.png --format jpeg --output photo.jpgimgresize --path logo.png --remove-alpha --output logo-opaque.pngimgresize -p original.jpg -s 1024x768 -f png -o thumbnail.pngPNG, JPEG, JPEG XL, TGA, GIF, BMP, SQZ, QOI, QOIX, DDSPNG, JPEG, TGA, GIF, BMP, SQZ, QOI, QOIX, DDSFor dependencies check out the dub.json file:
- gamut - Image encoding/decoding library
- stb_image_resize2 - High-quality image resizing
MIT.