Crates.io | reimg |
lib.rs | reimg |
version | 0.0.2 |
created_at | 2025-08-26 17:22:40.14538+00 |
updated_at | 2025-09-13 10:49:39.969829+00 |
description | A simple CLI tool to resize images. |
homepage | |
repository | https://github.com/ije/reimg |
max_upload_size | |
id | 1811560 |
size | 47,115 |
A simple CLI tool for web image resizing, using image-rs.
cargo install reimg
reimg -w 512 -h 512 --cover -f avif < input.jpg > output.avif
This tool uses stdin/stdout to read and write data. That allows you to use it as a pipeline. For example, you can use it in a Bun app to resize an image.
import { $ } from "bun";
const out = await $`reimg -w ${512} -h ${512} --cover -f avif < ${Bun.file("input.jpg")}`;
const res = new Response(out.arrayBuffer(), {
headers: {
"Content-Type": "image/avif",
},
});
$ reimg
Usage: reimg [OPTIONS] < input_image_file > output_image_file
Options:
-w, --width <width> Set the width of the output image
-h, --height <height> Set the height of the output image
--cover Resize the image to fill the given width and height, cropping if necessary
--contain Resize the image to fit the given width and height
--scale-down Resize the image to fit the given width and height, but not larger than the original
-q, --quality <quality> Set the quality of the output image [default: 85]
-f, --format <format> Set the format of the output image [possible values: jpeg, png, webp, avif, ico ]
-i, --info Show image metadata
MIT