| Crates.io | png-resizer |
| lib.rs | png-resizer |
| version | 1.0.0 |
| created_at | 2026-01-12 07:23:51.461247+00 |
| updated_at | 2026-01-12 07:23:51.461247+00 |
| description | High-performance PNG image resizer built with Rust and fast_image_resize library |
| homepage | https://github.com/cumulus13/png-resizer |
| repository | https://github.com/cumulus13/png-resizer |
| max_upload_size | |
| id | 2037190 |
| size | 47,701 |
High-performance PNG image resizer built with Rust and the fast_image_resize library.
cargo install png-resizer
git clone https://github.com/cumulus13/png-resizer
cd png-resizer
cargo build --release
Binary will be at ./target/release/png-resizer
png-resizer input.png --width 800 -o output.png
png-resizer input.png --width 800 --height 600 -o output.png
# Fastest (lower quality)
png-resizer input.png -w 800 -o output.png -a nearest
# High quality (default)
png-resizer input.png -w 800 -o output.png -a lanczos3
png-resizer input.png -w 800 -o output.png --no-threads
Usage: png-resizer [OPTIONS] <INPUT> --output <OUTPUT> --width <WIDTH>
Arguments:
<INPUT> Input PNG file path
Options:
-o, --output <OUTPUT> Output PNG file path
-w, --width <WIDTH> Target width (pixels)
--height <HEIGHT> Target height (pixels). If not specified, maintains aspect ratio
-a, --algorithm <ALGORITHM> Resize algorithm [default: lanczos3] [possible values: nearest, bilinear, catmull, mitchell, lanczos3]
--no-threads Disable multithreading
-v, --version Show version information
-h, --help Print help
| Algorithm | Speed | Quality | Best For |
|---|---|---|---|
nearest |
⚡⚡⚡⚡⚡ | ⭐ | Pixel art, extremely fast preview |
bilinear |
⚡⚡⚡⚡ | ⭐⭐⭐ | General use, good speed/quality balance |
catmull |
⚡⚡⚡ | ⭐⭐⭐⭐ | Smooth edges, natural looking |
mitchell |
⚡⚡⭐ | ⭐⭐⭐⭐ | Balanced sharpness and smoothness |
lanczos3 |
⚡⚡ | ⭐⭐⭐⭐⭐ | Best quality (default, recommended) |
png-resizer photo.png -w 1920 -o photo_resized.png
png-resizer large_image.png -w 300 -o thumbnail.png
# Bash/Linux
for file in *.png; do
png-resizer "$file" -w 800 -o "resized_$file"
done
# PowerShell
Get-ChildItem *.png | ForEach-Object {
png-resizer $_.Name -w 800 -o "resized_$($_.Name)"
}
# Maximum quality (slower)
png-resizer input.png -w 1200 -o high_quality.png -a lanczos3
# Fast processing (lower quality)
png-resizer input.png -w 1200 -o fast.png -a bilinear
This tool uses fast_image_resize, which is one of the fastest image resizing libraries available:
Performance comes from:
fast_image_resize provides:
When --height is not specified, the tool automatically calculates the height to maintain the original image's aspect ratio:
new_height = original_height × (new_width / original_width)
If you need additional features, consider:
fast_image_resize)Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.