https://github.com/yamafaktory/picst
A cross-platform CLI tool to resize clipboard images on the fly
https://github.com/yamafaktory/picst
cli clipboard image rust rust-cli tool tools
Last synced: over 1 year ago
JSON representation
A cross-platform CLI tool to resize clipboard images on the fly
- Host: GitHub
- URL: https://github.com/yamafaktory/picst
- Owner: yamafaktory
- License: mit
- Created: 2022-11-06T16:38:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-18T07:56:06.000Z (about 3 years ago)
- Last Synced: 2024-10-13T13:27:44.555Z (over 1 year ago)
- Topics: cli, clipboard, image, rust, rust-cli, tool, tools
- Language: Rust
- Homepage:
- Size: 207 KB
- Stars: 37
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
```
██████╗ ██╗ ██████╗███████╗████████╗
██╔══██╗██║██╔════╝██╔════╝╚══██╔══╝
██████╔╝██║██║ ███████╗ ██║
██╔═══╝ ██║██║ ╚════██║ ██║
██║ ██║╚██████╗███████║ ██║
╚═╝ ╚═╝ ╚═════╝╚══════╝ ╚═╝
```
[](https://github.com/yamafaktory/picst/actions/workflows/ci.yml) [](https://crates.io/crates/picst)
## 📷 Presentation
`picst` is a small cross-platform CLI tool aiming at making the "copy → resize → paste" image workflow super simple and more friendly.
Start `picst`, copy an image, eventually provide new dimensions if not passed via the flags, paste it anywhere - a piece of cake 🍰!
## 🛠️ Installation
### Cargo
```sh
cargo install picst
```
### Binaries
Binaries for new releases are also available [here](https://github.com/yamafaktory/picst/releases).
## ⚡️ Usage
`picst` is able to manage three different kind of unit to resize images: `percent` | `pixels` | `ratio`.
Note: `picst` will keep running and checking for new images copied in the clipboard until the process is stopped.
### Percent
Use the `--height-percent` or the `--width-percent` flags:
```sh
picst --height-percent 30
```
```sh
picst --width-percent 50
```
By default, `picst` preserves the aspect ratio of the image and will adjust the other dimension accordingly.
You can either skip this behavior with the `--ignore-aspect-ratio` flag - the tool will then prompt you for the other dimension - or you can directly set both flags:
```sh
picst --height-percent 30 --width-percent 50
```
### Pixels
Use the `--height` or the `--width` flags:
```sh
picst --height 300
```
```sh
picst --width 500
```
By default, `picst` preserves the aspect ratio of the image and will adjust the other dimension accordingly.
You can either skip this behavior with the `--ignore-aspect-ratio` flag - the tool will then prompt you for the other dimension - or you can directly set both flags:
```sh
picst --height 300 --width 500
```
### Ratio
Use the `--ratio` flag:
```sh
picst --ratio 0.7
```
### Special case: no flags
If no flags are passed to the tool, a complete wizard will be presented to you:
```sh
picst
```
```sh
Pixel --------┐
|---> Height* | Width* | Both ---> value(s)
Percentage ---┘
Ratio ------------> value
```
- With **Height** and **Width**, the aspect ratio will be preserved.