Achno / gowall

A tool to convert a Wallpaper's color scheme / palette
https://achno.github.io/gowall-docs/
MIT License
424 stars 8 forks source link

Error using the -r flag #17

Closed Dageus closed 5 hours ago

Dageus commented 6 hours ago

OS: Linux Distro: Arch Linux 6.11.6 Terminal Emulator: Alacritty Shell: zsh

Installed from AUR.

command:

➜  ~ gowall convert ~/Pictures/Wallpapers/wallpaper.vagabond.jpg -r #312424,#1D1C2D
Error: flag needs an argument: 'r' in -r
Usage:
  gowall convert [image path / batch flag] [flags]

Flags:
  -b, --batch strings     Usage: --batch file1.png,file2.png ...
  -f, --format string     Usage: --format [Extension]
  -h, --help              help for convert
  -r, --replace strings   Usage: --replace #FromColor,#ToColor
  -t, --theme string      Usage : --theme [ThemeName] (default "catppuccin")

I was wondering if I used the command wrong, but it seems correct according to the usage in the readme,

Dageus commented 6 hours ago

Error also occurs if I build from source.

Achno commented 5 hours ago

@Dageus Im also using Alacritty and zsh with the AUR version and i cant reproduce it. Can you upload the image wallpaper.vagabond.jpg ?

Also have you installed the zsh completions?

Dageus commented 5 hours ago

image: wallpaper vagabond

i have the zsh-autosuggestions, I don't know if that's what you're referring to

Achno commented 5 hours ago

@Dageus I think your shell might be intercepting the # delimiter for some reason thats the reason why it would print flag needs an argument: 'r' in -r because there isn't anything after -r

Try putting " " around the colors:

gowall convert ~/Pictures/Wallpapers/wallpaper.vagabond.jpg -r "#312424,#1D1C2D"

(obviously your image does not contain the 312424 color but you get the point)

Dageus commented 5 hours ago

yeah when I put it in quotes it worked, thanks man!

Achno commented 5 hours ago

@Dageus No problem, though another thing i noticed is that even though the color pickers say that the background black color in the image is #171717 probably because of the conversion of the image to rgb points there are very small discrepancies and that color becomes something else like #171719.

So when i try to look for #171717 in the image it doesn't really exist.

I will have to revise the algorithm used and relax the constraints so it doesn't have to be that exact pixel. So what im saying is if you get too many

Error Processing Image: while processing image : replacing color failed : the color : #171717 was not found in the image,nothing to replace

dont get discouraged i will fix it within this week i hope. I already somewhat hacked it together in a few minutes but i need some time to refine it

Achno commented 5 hours ago

Okay good news i relaxed the constraints a bit and now it matches the colors : https://freeimage.host/i/2RWzIfI here is your previous image with the background turned purple so you can see the difference (ignore the blurriness).

I will push the change this week

Dageus commented 4 hours ago

You're blazing fast man! thanks for the quick update