gowall

repository·main·Indexed 25 days ago

https://github.com/achno/gowall

A versatile CLI tool for image processing and color scheme application. Gowall provides capabilities for theming wallpapers and icons (supporting schemes like Catppuccin, Dracula, and Nord), AI upscaling, image compression, background removal, and OCR. It includes a comprehensive color manipulation suite for blending, converting, and generating gradients, as well as drawing tools for adding borders, grids, and rounded corners to images.

Tokens
6.3K
Snippets
13
Records
53
Agent score
80%

What's inside gowall

  1. Overview of Gowall features

    main

    Gowall is a CLI-based image processing swiss army knife. Key capabilities include:

    • Theming: Convert wallpapers or icons (svg, ico) to match specific color schemes (e.g., Catppuccin, Dracula, Nord).
    • Image Processing: Compression (png, jpeg, jpg, webp), AI upscaling, background removal, and format conversion.
    • OCR: Extract text from images and PDFs using 9+ providers.
    • Artistic Effects: Pixel art transformation, color palette extraction, GIF creation from images, and color inversion.
    • Terminal Integration: Supports Unix pipes/redirection (stdin/stdout) and features an Image preview mode to print images directly in the terminal.
    • Utility: Replace specific colors, draw borders/grids, and apply effects like Mirror, Flip, or Grayscale.
  2. Manage and use Gowall themes

    main

    Gowall supports many built-in themes including Catppuccin, Dracula, Everforest, Gruvbox, Nord, Onedark, Solarized, and Tokyo-dark/storm/moon.

    • List themes: Use gowall list to see all available default and user-created themes.
    • Custom themes: User-created themes are managed via ~/.config/gowall/config.yml. Detailed instructions for creating custom themes can be found in the official documentation.
  3. Build Gowall from source

    main

    To use the cutting-edge version or contribute to the project, you can build from source using Go.

    1. Clone the repository.
    2. Run go build.
    3. Move the resulting binary to your $PATH.
    git clone https://github.com/Achno/gowall
    cd gowall
    go build
    sudo cp gowall /usr/local/bin/
    gowall
  4. Install Gowall via package managers

    main

    Gowall is available through several package managers depending on your operating system:

    • MacOS (Homebrew): brew install gowall (currently on v0.2.0)
    • Arch Linux (AUR): yay -S gowall
    • Fedora (COPR):
      sudo dnf copr enable achno/gowall
      sudo dnf install gowall
    • NixOS: Add pkgs.gowall to your environment.systemPackages.
    • Void Linux: sudo xbps-install -S gowall
    brew install gowall
  5. Build Gowall on Windows

    main

    To build on Windows, you must have go and zig installed (e.g., via scoop). You must enable CGO and use zig cc as the compiler.

    # Using PowerShell
    $env:CGO_ENABLED=1
    $env:CC="zig cc"
    $env:CXX="zig c++"
    
    go clean -cache
    go build -v
    $env:CGO_ENABLED=1
    $env:CC="zig cc"
    $env:CXX="zig c++"
    
    go clean -cache 
    go build -v
  6. Install Gowall via binary (Preferred Method)

    main

    If your package manager does not support Gowall or provides an outdated version, download the latest stable release from the GitHub releases page.

    1. Download the .tar.gz file corresponding to your operating system and architecture.
    2. Extract the gowall binary.
    3. Move the binary to a directory in your $PATH (e.g., /usr/local/bin/).

    Verify your installation by running gowall -v and comparing it to the version on the release page.

    sudo cp gowall /usr/local/bin/
  7. Use the `color` command to manipulate colors

    main

    The color command is a sub-command suite for working with color palettes, conversions, and transformations. It provides several specialized sub-commands for generating shades, blending colors, and working with color wheels.

    Available sub-commands:

    • convert: Convert colors between formats (hex, rgb, hsl, lab).
    • light: Lighten a color.
    • dark: Darken a color.
    • blend: Blend two colors together.
    • variants: Generate shades, tints, or tones.
    • wheel: Generate color schemes based on the color wheel.
    • gradient: Generate a gradient image from multiple colors.
  8. How OCR configuration is loaded

    main

    The ocr command follows a three-step hierarchy to determine its configuration:

    1. Default Configuration: The command starts with a set of hardcoded default values (e.g., default DPI, default prompts, and default rate limits).
    2. Schema Overrides: If the --schema flag is provided, the command looks for a schema file at ~/.config/gowall/<OCR_SCHEMA_FILE_NAME>. It searches for a schema matching the provided name and merges its configuration into the defaults. Schema values override defaults.
    3. Flag Overrides: Any flags explicitly passed in the CLI command (e.g., --provider, --dpi) will overwrite both the default and the schema-loaded values.

    Schema File Location: ~/.config/gowall/<OCR_SCHEMA_FILE_NAME>

  9. Use the effects command to apply image transformations

    main

    The effects command is a sub-command group used to apply various visual transformations to images. The general syntax is:

    effects [EFFECT] [INPUT] [OPTIONAL OUTPUT]

    Available effects include:

    • flip: Flips the image horizontally.
    • mirror: Mirrors the image horizontally.
    • grayscale: Converts the image to shades of gray.
    • br: Adjusts brightness.
    • contrast: Adjusts image contrast using either normal or sigmoid modes.
    • gamma: Applies gamma correction.
    • saturation: Adjusts color saturation.
    • tilt: Applies a 3D tilt effect with rounded corners and a background.
  10. Replace colors in an image using the --replace flag

    main

    To replace a specific color in an image, use the --replace flag with a comma-separated list of values.

    Syntax: --replace #FromColor,#ToColor or --replace #FromColor,#ToColor,#Threshold

    • #FromColor: The hex color code you want to find.
    • #ToColor: The hex color code you want to use as the replacement.
    • #Threshold (Optional): A numeric value representing the sensitivity of the color match. If omitted, the default threshold is 8.5.

    Example: To replace black (#000000) with white (#FFFFFF) with a threshold of 10.5:

    gowall convert input.jpg --replace #000000,#FFFFFF,10.5
  11. Reference: `list` command flags

    main

    The list command supports the following flags to filter or extend the output:

    FlagShorthandDescription
    --theme-tSpecify a theme name to retrieve its colors.
    --preview-pIf a theme is specified, opens the hex code preview site.

    Note: The --preview flag is intended to be used in conjunction with the --theme flag.