Compare commits

..

6 Commits

Author SHA1 Message Date
Waveplate
33d8702f5a update release binary url 2025-04-21 21:20:50 -07:00
Waveplate
df2a135437 increase minor version, update usage docs 2025-04-21 21:12:28 -07:00
Waveplate
2459c6e06c bugfix: mixup between RGB and IRC99 colour code values in irc_draw_braille 2025-04-21 21:11:18 -07:00
Waveplate
4724956862 bugfix: collision between height and help 2025-04-21 21:10:49 -07:00
waveplate
3577cf95a2
fix formatting 2024-12-16 17:04:38 -08:00
waveplate
148f809623
add braille output example 2024-12-15 21:05:40 -08:00
4 changed files with 16 additions and 12 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "img2irc-rs" name = "img2irc-rs"
version = "1.1.0" version = "1.1.1"
authors = ["waveplate"] authors = ["waveplate"]
github = "https://github.com/waveplate/img2irc" github = "https://github.com/waveplate/img2irc"
repository = "https://github.com/waveplate/img2irc" repository = "https://github.com/waveplate/img2irc"

View File

@ -1,4 +1,6 @@
# img2irc (1.1.0) # img2irc (1.1.1)
![img2irc braille example](https://i.imgur.com/ZEJwuOb.png)
![img2irc preview](https://i.imgur.com/0omljq5.png) ![img2irc preview](https://i.imgur.com/0omljq5.png)
*img2irc* is a premiere command-line utility which converts images to irc/ansi art, with a lot of post-processing filters *img2irc* is a premiere command-line utility which converts images to irc/ansi art, with a lot of post-processing filters
@ -10,18 +12,18 @@
statically linked with musl, works on all x86_64 linux platforms statically linked with musl, works on all x86_64 linux platforms
cd /tmp cd /tmp
wget https://github.com/waveplate/img2irc/releases/download/v1.1.0/img2irc-1.1.0-linux-x86_64.tar.gz wget https://github.com/waveplate/img2irc/releases/download/v1.1.1/img2irc-1.1.1-linux-x86_64.tar.gz
sudo tar -xzf img2irc-1.1.0-linux-x86_64.tar.gz -C /usr/local/bin --strip-components=1 img2irc-1.1.0/img2irc sudo tar -xzf img2irc-1.1.1-linux-x86_64.tar.gz -C /usr/local/bin --strip-components=1 img2irc-1.1.1/img2irc
rm -rf img2irc-1.1.0-linux-x86_64.tar.gz rm -rf img2irc-1.1.1-linux-x86_64.tar.gz
- ### install with `yay` (arch linux) - ### install with `yay` (arch linux)
yay -S img2irc
> [!NOTE] > [!NOTE]
> if you like this project, i would appreciate you giving it a vote on the [aur](https://aur.archlinux.org/packages/img2irc)! > if you like this project, i would appreciate you giving it a vote on the [aur](https://aur.archlinux.org/packages/img2irc)!
yay -S img2irc
- ### install with `cargo` - ### install with `cargo`
cargo install img2irc-rs cargo install img2irc-rs
@ -36,7 +38,7 @@
|----------------------------------------|---------------------------------------------------------------|---------------| |----------------------------------------|---------------------------------------------------------------|---------------|
| image | image url or file path | required | | image | image url or file path | required |
| -w, --width | output image width in columns | auto | | -w, --width | output image width in columns | auto |
| -h, --height | output image height in rows | auto | | -H, --height | output image height in rows | auto |
| --scale | scaling factors (x:y, e.g., "2:2") | none | | --scale | scaling factors (x:y, e.g., "2:2") | none |
| --aspect | final aspect ratio (x:y, e.g., "2:1") | none | | --aspect | final aspect ratio (x:y, e.g., "2:1") | none |
| --crop | crop image ("x1,y1,x2,y2") | none | | --crop | crop image ("x1,y1,x2,y2") | none |
@ -118,3 +120,5 @@
| --frostedglass | blurred, frosted appearance as if viewed through semi-transparent surface | false | | --frostedglass | blurred, frosted appearance as if viewed through semi-transparent surface | false |
| --solarize | strange, otherworldly appearance with inverted colors and surreal atmosphere | false | | --solarize | strange, otherworldly appearance with inverted colors and surreal atmosphere | false |
| --edgedetection | highlights edges and boundaries in an image | false | | --edgedetection | highlights edges and boundaries in an image | false |
![img2irc braille example](https://i.imgur.com/MxroWUb.png)

View File

@ -25,11 +25,11 @@ pub struct Args {
pub image: String, pub image: String,
/// output image width in columns /// output image width in columns
#[arg(short, long)] #[arg(short = 'w', long)]
pub width: Option<u32>, pub width: Option<u32>,
/// output image height in rows /// output image height in rows
#[arg(short, long)] #[arg(short = 'H', long)]
pub height: Option<u32>, pub height: Option<u32>,
/// scaling factors (x:y, e.g., "2:2") /// scaling factors (x:y, e.g., "2:2")

View File

@ -715,7 +715,7 @@ pub fn irc_draw_braille(image_luma: &AnsiImage, image_chroma: &AnsiImage, args:
let scaled_threshold = min_luma + (luma_range / 2); let scaled_threshold = min_luma + (luma_range / 2);
for y in (0..height).step_by(4) { for y in (0..height).step_by(4) {
let mut last_fg = 255u8; let mut last_fg = 1u8;
let mut first = true; let mut first = true;
for x in (0..width).step_by(2) { for x in (0..width).step_by(2) {
let mut braille_char = 0x2800; let mut braille_char = 0x2800;