Skip to main content

Configuration

gummyworm supports configuration files for setting default options. This saves you from typing the same flags repeatedly.

Config File Locations

Config files are loaded in order (later files override earlier):

  1. ~/.config/gummyworm/config — XDG-style config
  2. ~/.gummywormrc — User defaults
  3. ./.gummywormrc — Project-specific (current directory)

CLI arguments always take precedence over config file settings.

File Format

Simple key=value format, one setting per line:

# Comments start with #
width=120
palette=blocks
color=true

Comments

Lines starting with # are treated as comments and ignored:

# This is a comment
width=120

# Blank lines are also ignored
palette=blocks

Note: Inline comments are not supported. Put comments on their own lines.

width=120  # This won't work - the "# This..." becomes part of the value!

Values can be quoted or unquoted:

background=#1e1e1e
background="#1e1e1e"
background='#1e1e1e'

Available Settings

Dimensions

KeyDefaultDescription
width80Output width in characters
height0Output height (0 = auto from aspect ratio)
preserve_aspecttrueMaintain image aspect ratio

Palette

KeyDefaultDescription
palettestandardPalette name or custom characters (see Palettes Guide)

Color

KeyDefaultDescription
colorfalseEnable 256-color output
truecolorfalseEnable 24-bit true color
invertfalseInvert brightness mapping

Image Preprocessing

KeyDefaultDescription
brightness0Adjust brightness (-100 to 100)
contrast0Adjust contrast (-100 to 100)
gamma1.0Adjust gamma (0.1 to 10.0)

Export

KeyDefaultDescription
formattextOutput format (see Export Formats)
background#1e1e1eBackground color for exports
padding0Padding in pixels for exports

Animation

KeyDefaultDescription
animateautoAnimation mode (auto, true, false)
frame_delay100Milliseconds between frames
max_frames0Max frames to process (0 = all)
loops0Loop count (0 = infinite, see Animation Options)

Other

KeyDefaultDescription
quietfalseSuppress info messages

Example Configurations

Color Photography Workflow

For photographers who regularly convert images:

# ~/.gummywormrc
width=120
color=true
truecolor=true
palette=detailed
brightness=10
contrast=15

Terminal Art Profile

For creating ASCII art in terminals:

# ~/.gummywormrc
width=80
palette=blocks
color=true
background=#000000

Web Export Workflow

For generating HTML galleries:

# ~/.gummywormrc
format=html
width=100
color=true
padding=20
background=#1a1a2e

Project-Specific Config

Create .gummywormrc in a project directory:

# ./project/.gummywormrc
width=60
palette=simple
quiet=true

Getting Started

  1. Copy the example config (from the repository root):

    # If installed from source:
    cp .gummywormrc.example ~/.gummywormrc

    # Or create from scratch:
    touch ~/.gummywormrc
  2. Edit to your preferences:

    # ~/.gummywormrc
    width=100
    color=true
    palette=blocks
  3. Run gummyworm — your defaults are applied:

    gummyworm photo.jpg  # Uses width=100, color, blocks palette
  4. Override any setting with CLI flags:

    gummyworm -w 60 photo.jpg  # Uses width=60, but keeps other config

Tips

  • Use ~/.gummywormrc for your personal preferences
  • Use ./.gummywormrc in project directories for project-specific settings
  • Settings not in your config file use the built-in defaults
  • CLI arguments always win over config file settings