https://github.com/PatriikPlays/img2poster
Image to poster converter tool for SwitchCraft3 posters.
https://github.com/PatriikPlays/img2poster
Last synced: 7 months ago
JSON representation
Image to poster converter tool for SwitchCraft3 posters.
- Host: GitHub
- URL: https://github.com/PatriikPlays/img2poster
- Owner: PatriikPlays
- License: gpl-2.0
- Created: 2023-04-22T22:05:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T19:11:37.000Z (over 1 year ago)
- Last Synced: 2024-08-04T02:07:40.683Z (over 1 year ago)
- Language: Rust
- Size: 95.7 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-computercraft - img2poster - Allows converting from popular image formats to 2dj poster format. (Non-Lua programs / Tools)
README
# img2poster

Rust based CLI tool for converting and manipulating [SwitchCraft3](https://sc3.io) posters.
## Installation
### Windows
1. Download the latest windows executable from GitHub releases (`img2poster-win.exe`)
2. Open your terminal (cmd)
3. Use it! Check out usage guide below
### Linux
1. Download the latest Linux executable from GitHub releases (`img2poster-lnx`)
2. Open your terminal of choice
3. Use it! Check the usage guide below
## Usage
### Input
> [!NOTE]
> This argument is required
The input argument is the file path to the source image/poster you want to convert into a poster/image.
Syntax:
- `-i `
- `--input `
Examples:
- `-i ./apioform.png`
- `-i /home/me/images/capy64.jpg`
- `--input ~/mfw.jpg`
- `-i ./poster.2dj`
- `-i ./poster.2dja`
---
### Output
> [!NOTE]
> This argument is required
The output argument is the file path where you want your poster/image files to end up.
Syntax:
- `-o `
- `--output `
Examples:
- `-o ./myPoster.2dj`
- `--output ~/anotherPoster.2dja`
- `-o /home/me/myImage.png`
- `--output ./myImage.jpg`
---
### Preview
It is possible to preview the poster in a normal image format.
To do this specify the preview argument with a path.
Syntax:
- `-p `
- `--preview `
Examples:
- `-p ~/myPreview.png`
- `-p ../myPreview.bmp`
- `--preview ./myPreview.jpg`
- `--preview /home/me/myPreview.jpeg`
---
### Autoscale
Autoscale automatically scales the image to its original resolution, rounded to nearest 128px.
Syntax:
- `-a `
- `-autoscale `
Examples:
- `--autoscale 2` will resize to 2x the size of the input image
- `-a 1` will resize to the closest possible size of the input image
---
### Scale X
The scale-x argument is the amount of pixels on the X axis to scale the poster to.
A single poster is always 128x128, which means that **this field has to be a multiple of 128.**
> [!NOTE]
> Only use with image input files, not 2dj/2dja
> [!NOTE]
> Cannot be used with autoscale
Syntax:
- `-x `
- `--scale-x `
Examples:
- `-x 256`
- `-x 384`
- `--scale-x 128`
---
### Scale Y
The scale-y argument is the amount of pixels on the Y axis to scale the poster to.
A single poster is always 128x128, which means that this field has to be a multiple of 128.
> [!NOTE]
> Only use with image input files, not 2dj/2dja
> [!NOTE]
> Cannot be used with autoscale
Syntax:
- `-y `
- `--scale-y `
Examples:
- `-y 256`
- `-y 384`
- `--scale-y 128`
---
### Resizing Algorithm
The algorithm to use for scaling the input.
Acceptable values:
- `nearest`
- `triangle`
- `catmull-rom` (default)
- `gaussian`
- `lanczos3`
Syntax:
- `-r `
- `--resize-algorithm `
Examples:
- `-r nearest`
- `--resize-algorithm lanczos3`
---
### Poster Label
The poster label argument is what to label the poster as.
> [!NOTE]
> Only use with image input files, not 2dj/2dja
> [!NOTE]
> The poster label cannot be longer than 25 characters
> [!NOTE]
> The label will end up as `: (x,y)/(totalX*totalY)`. To force your own label use -L (see below)
Syntax:
- `-l `
- `--label `
Examples:
- `-l myPoster`
- `--label ApioformPoster2`
---
### Force poster label
The force poster label argument overwrites the actual label, instead of the default `: (x,y)/(totalX*totalY)`.
> [!NOTE]
> Only use with image input files, not 2dj/2dja
Syntax:
- `-L `
- `--forcelabel `
Examples:
- `-L FunnyPoster`
- `--forcelabel veryPostery`
---
### Force poster tooltip
The force poster tooltip argument overwrites the default tooltip with the supplied string.
> [!NOTE]
> Only use with image input files, not 2dj/2dja
Syntax:
- `-T `
- `--forcetooltip `
Examples:
- `-T MyCoolTooltip`
- `--forcetooltip VeryTooltip`
---
### Per poster quantization
The per poster quantization flag makes the program select the colorpalette on a per-poster basis.
> [!NOTE]
> Only use with image input files, not 2dj/2dja
Syntax:
- `-Q`
- `--per-poster-quantization`
Examples:
- `-Q`
- `--per-poster-quantization`