Metadata-Version: 2.4
Name: resizy
Version: 0.1.0
Summary: A fast, resilient CLI for batch image resizing, conversion, and compression.
Project-URL: Homepage, https://github.com/your-org/resizy
Project-URL: Issues, https://github.com/your-org/resizy/issues
Project-URL: Source, https://github.com/your-org/resizy
Author: Resizy Contributors
License: MIT
License-File: LICENSE
Keywords: cli,compression,image-processing,pillow,resize,rich,typer,webp
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Requires-Dist: pillow>=10.3.0
Requires-Dist: rich>=13.7.1
Requires-Dist: typer>=0.12.3
Provides-Extra: dev
Requires-Dist: pytest>=8.2.0; extra == 'dev'
Requires-Dist: ruff>=0.4.4; extra == 'dev'
Provides-Extra: publish
Requires-Dist: build>=1.2.1; extra == 'publish'
Requires-Dist: twine>=5.1.0; extra == 'publish'
Description-Content-Type: text/markdown

# Resizy

[![PyPI](https://img.shields.io/pypi/v/resizy.svg)](https://pypi.org/project/resizy/)
[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![CLI: Typer](https://img.shields.io/badge/CLI-Typer-0ea5e9.svg)](https://typer.tiangolo.com/)
[![Terminal UI: Rich](https://img.shields.io/badge/TUI-Rich-f43f5e.svg)](https://github.com/Textualize/rich)

**Resizy** is a fast, production-minded CLI for batch image resizing, conversion, and compression. It keeps the terminal responsive with `ProcessPoolExecutor`, validates images before processing, and gives every run a polished Rich progress UI.

![Resizy terminal demo](docs/assets/resizy-demo.gif)

![Resizy summary](docs/assets/resizy-summary.png)

## Why Developers Like It

- Resize, convert, and compress hundreds of images from one command.
- Keep your shell readable with Rich progress bars, panels, and summaries.
- Avoid heavyweight services. No Docker, Redis, Celery, or background daemon.
- Install globally with `pipx`, isolated from your app dependencies.
- Gracefully handles corrupted files, invalid formats, and partial failures.

## Install

`pipx` is recommended because it installs Resizy as a global terminal command while keeping its dependencies isolated from your projects.

If you already have `pipx`:

```bash
pipx install resizy
```

If `pipx` is not installed yet:

```bash
python -m pip install --user pipx
python -m pipx ensurepath
```

Close and reopen your terminal, then run:

```bash
pipx install resizy
```

On Windows, if `python` is not available but the Python launcher is:

```powershell
py -m pip install --user pipx
py -m pipx ensurepath
pipx install resizy
```

Before Resizy is published to PyPI, install it locally from the repository:

```bash
git clone https://github.com/your-org/resizy.git
cd resizy
pipx install .
```

For local development:

```bash
pip install -e ".[dev]"
```

Run the test suite:

```bash
pytest
```

## Usage

Convert the demo images to compact WebP files:

```bash
resizy run ./examples/images --format webp --width 1000 --quality 82 --output ./examples/output
```

Convert JPEG and PNG assets to WebP with smart compression:

```bash
resizy run ./images --format webp --quality 82
```

Process nested folders with more workers:

```bash
resizy run ./assets --recursive --workers 8 --format webp --width 1920
```

Write outputs to a specific directory:

```bash
resizy run ./campaign --output ./dist/images --width 1200 --quality 76
```

Resize a single file:

```bash
resizy run ./hero.png --format jpeg --width 2400 --quality 88
```

Delete originals after successful processing:

```bash
resizy run ./raw --format webp --cleanup-originals
```

## CLI Options

```bash
resizy run --help
```

Common flags:

- `--width`, `--height`: Resize while preserving aspect ratio.
- `--format`: Convert to `jpeg`, `png`, `webp`, `bmp`, or `tiff`.
- `--quality`: Compression quality from `1` to `100`.
- `--workers`: Number of background worker processes.
- `--recursive`: Scan directories recursively.
- `--output`: Choose the output directory.
- `--overwrite`: Replace existing output files.
- `--preserve-metadata`: Preserve EXIF metadata when supported.
- `--cleanup-originals`: Remove source files after successful processing.

## Architecture

Resizy is intentionally small and scalable:

- `cli.py` owns command parsing and terminal presentation.
- `processor.py` owns validation, image operations, and process-pool orchestration.
- `config.py` centralizes supported formats, defaults, and package settings.

The main process stays responsive while CPU-bound image work runs in isolated worker processes. Results are streamed back as each file completes, so users get real-time feedback instead of a frozen terminal.

## Supported Inputs

Resizy accepts JPEG, PNG, WebP, GIF, BMP, and TIFF images. Each file is opened and verified with Pillow before processing so corrupted or unsupported files fail gracefully in the summary table.

## License

MIT
