https://github.com/canop/squale
Small utility to scale images
https://github.com/canop/squale
Last synced: 10 months ago
JSON representation
Small utility to scale images
- Host: GitHub
- URL: https://github.com/canop/squale
- Owner: Canop
- Created: 2023-03-04T17:58:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T20:15:12.000Z (about 3 years ago)
- Last Synced: 2025-09-15T12:24:15.438Z (10 months ago)
- Language: Rust
- Size: 58.6 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# squale
[![MIT][s2]][l2] [![Latest Version][s1]][l1] [![Chat on Miaou][s4]][l4]
[s1]: https://img.shields.io/crates/v/squale.svg
[l1]: https://crates.io/crates/squale
[s2]: https://img.shields.io/badge/license-MIT-blue.svg
[l2]: LICENSE
[s4]: https://miaou.dystroy.org/static/shields/room.svg
[l4]: https://miaou.dystroy.org/3768?Rust
A small utility upscaling or downscaling images.
## Installation
```bash
cargo install squale
```
## Usage
Specify the dimensions that output images must fit and pass image path(s) as argument:
```bash
squale --fit 800x600 trav/tracteurs/*
```
Squale filters out non images and files whose name looks like its own output.
Generated images are named according to the specified fitting rectangle (real image dimensions may be smaller, as proportions are kept).
For example, assuming you have those files:

Run
```bash
squale --fit 800x600 trav/tracteurs/*
```
Then, you'll get

List of arguments is available on `squale --help`
## Output images
Images are scaled up or down with the Lanczos sampling algorithm (window 3) which isn't terribly fast but gives excellent results.
Scaled PNG, ICO, and BMP images are saved as PNG.
Other kinds of images are saved as JPEG. Default quality is 85 but it can be changed with the `--jpeg-quality` parameter.