https://github.com/sean1832/pix
a simple image manipulation cli for the terminal
https://github.com/sean1832/pix
cli image-processing
Last synced: 5 months ago
JSON representation
a simple image manipulation cli for the terminal
- Host: GitHub
- URL: https://github.com/sean1832/pix
- Owner: sean1832
- License: apache-2.0
- Created: 2024-03-29T15:50:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T06:38:59.000Z (about 2 years ago)
- Last Synced: 2025-12-11T14:57:35.341Z (7 months ago)
- Topics: cli, image-processing
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PIX
[](https://pypi.org/project/zz-pix)
[](LICENSE)
[](https://pepy.tech/project/zz-pix)

A simple image manipulation tool for the terminal.
> ⭐️ Like this repo? please consider a star!
> 💡 This project is still earily in its development. Please report any bugs or issues you encounter.
## 🌟 Features
- [x] Resize
- [x] Crop
- [x] Convert
- [x] Prune (remove low-quality images)
- [x] Caption (add text & metadata to images)
- [x] Transparency
- [ ] Watermark
- [ ] Grayscale
## 💻 Installation
### Using pip (Recommended)
```sh
pip install zz-pix
```
### From Source
```bash
git clone https://github.com/sean1832/pix.git
cd pix
pip install .
```
## 🔨 Usage
### Basic Usage
```sh
pix [COMMAND] [OPTIONS]
```
Replace `[COMMAND]` with the desired operation and `[OPTIONS]` with the relevant options for your command.
### Global Options
- `-v`, `--version`: Display the version of the tool.
- `-h`, `--help`: Display the help message.
### Commands
| Command | Description |
| ------------------- | ------------------------------------------------ |
| [convert](#convert) | Converts images to a different format |
| [resize](#resize) | Resizes images |
| [crop](#crop) | Crops images |
| [prune](#prune) | Removes images smaller than specified resolution |
### Command Options
#### Convert
Converts images to a different formats. Currently supports `JPEG`, `PNG`, `WEBP`, `TIFF`, `ICO`, `AVIF`, `HEIF`, `BMP`.
```sh
pix convert input.jpg output.webp [OPTIONS]
```
| Option | Input Type | Description | Default |
| --------------------- | ---------- | ---------------------------------------- | ------------ |
| `input` | String | Input image or directory | N/A |
| `output` | String | Output image or directory | Current dir. |
| `-f`, `--format` | String | Output format (supported formats listed) | N/A |
| `-q`, `--quality` | Integer | Output quality (0-100) | 95 |
| `--no-optimize` | Flag | Disable optimization | N/A |
| `-o`, `--overwrite` | Flag | Overwrite existing files | N/A |
| `-t`, `--transparent` | Flag | Preserve transparency | N/A |
| `--prefix` | String | Prefix for the output file name | "" |
| `--surfix` | String | Suffix for the output file name | "" |
#### Resize
Resizes images to a specified size or scale.
```sh
pix resize input.jpg output.jpg [OPTIONS]
```
| Option | Input Type | Description | Default |
| ------------- | ---------- | ------------------------- | ------------ |
| `input` | String | Input image or directory | N/A |
| `output` | String | Output image or directory | Current dir. |
| `--overwrite` | Flag | Overwrite existing files | N/A |
| `--size` | String | Output size (WxH) | N/A |
| `--scale` | Float | Output scale (0.0-1.0) | N/A |
#### Crop
Crops images to a specified size and position.
```sh
pix crop input.jpg output.jpg [OPTIONS]
```
| Option | Input Type | Description | Default |
| ------------- | ---------- | -------------------------------------------- | ------------ |
| `input` | String | Input image or directory | N/A |
| `output` | String | Output image or directory | Current dir. |
| `--overwrite` | Flag | Overwrite existing files | N/A |
| `--ratio` | String | Aspect ratio (W:H), combined with `--align` | N/A |
| `--size` | String | Exact size and position as WxH+X+Y | N/A |
| `--align` | String | Alignment (top, bottom, left, right, center) | N/A |
#### Prune
Removes images smaller than a specified resolution.
```sh
pix prune ./images [OPTIONS]
```
| Option | Input Type | Description | Default |
| -------------------- | ---------- | ---------------------------------------------- | ------- |
| input | String | Input image or directory | N/A |
| `-r`, `--resolution` | String | Minimum resolution (WxH) | N/A |
| `--dry-run` | Flag | List files to be removed without deleting them | N/A |
## License
[Apache-2.0](LICENSE)