diff options
Diffstat (limited to 'modules/zsh.nix')
| -rw-r--r-- | modules/zsh.nix | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/zsh.nix b/modules/zsh.nix index c79e460..e229c40 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -29,6 +29,26 @@ # vim keybindings bindkey -v + # imagemagick wrapper function to remove background + remove_bg() { + if [[ $# -lt 2 ]]; then + echo 'Usage: remove_bg <input_file> <fuzz_percentage> [transparent_color] [output_file]' + return 1 + fi + + local input_file=$1 + local fuzz=$2 + local transparent_color=$3 + local output_file=$4 + + magick "$input_file" \ + -fuzz "$fuzz" -transparent "$transparent_color" \ + -blur 0x1 \ + "$output_file" + + echo "Saved transparent image to: $output_file" + } + eval "$(zoxide init zsh)" ''; |
