Skip to main content

Palettes Guide

Palettes define which characters are used to represent different brightness levels in your ASCII art. gummyworm comes with 12 built-in palettes and supports custom palettes via inline strings or files.

How Palettes Work

A palette is an ordered string of characters from lightest (or empty) to darkest. When converting an image:

  1. Each pixel's brightness is calculated using luminance
  2. The brightness (0-255) is mapped to a character index
  3. The corresponding character from the palette is output

Example: With palette .oO@ (5 characters):

  • Very bright pixels → (space)
  • Bright pixels → .
  • Medium pixels → o
  • Dark pixels → O
  • Very dark pixels → @

Built-in Palettes

View all available palettes with:

gummyworm --list-palettes

See also: -l, --list-palettes in the CLI Reference.

PaletteCharactersBest For
standard .:-=+*#%@General purpose, good balance
detailed72 ASCII charsHigh-detail photos, portraits
simple .oO@Quick previews, small sizes
blocks ░▒▓█High contrast, bold images
binarySilhouettes, logos, line art
dots ⠁⠃⠇⠿⣿Braille-style, compact art
shades ░▒▓█Block shading
retro .:░▒▓█Retro computing aesthetic
matrix 01Matrix/hacker style
emoji🌑🌒🌓🌔🌕Fun social posts, moon phases
stars ·✦★✷✸✹Dreamy, celestial effects
hearts ♡♥❤💖💗Love-themed art

Visual Examples

Here's how the same circular shape looks with different palettes:

standard (default)

      .:::.
.::::::::.
:::::::::::
:::::::::::::
:::::::::::::
:::::::::::
'::::::::'
':::'

blocks

      ░▒▒░
░▒▒▒▒▒▒░
▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒
░▒▒▒▒▒▒░
░▒▒░

binary

      ███
███████
█████████
███████████
███████████
█████████
███████
███

emoji (smaller width recommended)

    🌓🌔🌔🌓
🌔🌕🌕🌕🌕🌔
🌔🌕🌕🌕🌕🌔
🌓🌔🌔🌓

Tip: Generate your own comparisons:

for p in standard blocks binary emoji; do
echo "=== $p ===" && gummyworm -p "$p" -w 40 photo.jpg
done

Usage Examples

# Standard palette (default)
gummyworm photo.jpg

# Block characters for bold output (see -p option in CLI Reference)
gummyworm -p blocks landscape.jpg

# Emoji for fun social sharing
gummyworm -p emoji -w 40 cat.jpg

# High detail for portraits
gummyworm -p detailed -w 150 portrait.png

# Binary for logos and silhouettes
gummyworm -p binary logo.png

# Braille dots for compact art
gummyworm -p dots -w 60 photo.jpg

Custom Palettes

Inline Custom Palettes

Specify a custom character string directly on the command line:

# Simple custom palette
gummyworm -p " .oO0@#" photo.jpg

# Block-based custom
gummyworm -p " ░▒▓█" photo.jpg

# ASCII art style
gummyworm -p " .',:;!|[{#@" photo.jpg

# Minimal
gummyworm -p " *#" photo.jpg

Rules for inline palettes:

  • Characters go from lightest to darkest
  • Start with a space for white/bright areas
  • Minimum 2 characters required
  • Special characters may need quoting

Palette Files

Create reusable palette files in the palettes/ directory with optional metadata.

File format: palettes/<name>.palette

# Name: My Palette
# Description: A brief description of the palette
# Author: Your Name
# Tags: unicode, artistic, high-contrast

~≈≋⌇░▒▓█

Metadata Fields

Palette files support optional metadata headers:

FieldDescription
NameDisplay name shown in --list-palettes
DescriptionBrief description of the palette
AuthorCreator's name
TagsComma-separated tags for categorization

All metadata is optional. Lines starting with # are comments. The first non-comment, non-empty line is the character set.

Example: Creating a custom palette

  1. Copy the template:

    cp palettes/_template.palette palettes/ocean.palette
  2. Edit palettes/ocean.palette:

    # Name: Ocean
    # Description: Wave-themed palette for water images
    # Author: Your Name
    # Tags: unicode, water, nature

    ~≈≋⌇░▒▓█
  3. Use it:

    gummyworm -p ocean beach.jpg

More example palettes:

palettes/arrows.palette:

# Name: Arrows
# Description: Directional arrow characters
# Tags: unicode, artistic
·→⇒▸▶►

palettes/boxes.palette:

# Name: Box Drawing
# Description: Box drawing and shade characters
# Tags: unicode, retro
╌╎┆┊░▒▓█

palettes/currency.palette:

# Name: Currency
# Description: Money-themed with currency symbols
# Tags: unicode, fun
·¢$€£¥₿

See palettes/README.md for more examples and the complete format specification.

Unicode and Emoji Considerations

Terminal Support

Not all terminals render Unicode characters equally:

Character TypeSupport Level
Basic ASCIIUniversal
Extended ASCII (░▒▓)Most terminals
Unicode symbols (✦★●)Modern terminals
Emoji (🌕❤️🔥)Varies widely
Braille (⠁⠃⠇)Good in modern terminals

Recommendation: Test your palette in your target terminal before batch processing.

Character Width

Some Unicode characters are "wide" (take 2 columns) while others are narrow (1 column). gummyworm handles this automatically when Python 3 is available.

Characters that may cause alignment issues:

  • Most emoji (2 columns wide)
  • CJK characters
  • Some symbols

Tip: The emoji palette works best at smaller widths (-w 40) due to wide characters.

Font Requirements

For best results with special characters:

Palette TypeRecommended Fonts
Block charactersAny monospace
BrailleDejaVu Sans Mono, Consolas
EmojiNoto Color Emoji, Apple Color Emoji
Stars/SymbolsFira Code, JetBrains Mono

Palette Selection Guide

By Image Type

Image TypeRecommended Palette
Portraitsdetailed, standard
Landscapesblocks, shades
Logos/Iconsbinary, simple
Photos (general)standard, detailed
Dark imagesblocks + -i (invert)
Artistic/stylizedemoji, stars, matrix

By Output Purpose

PurposeRecommended Palette
Terminal displaystandard, blocks
Text filestandard, detailed
HTML/WebAny (colors preserved)
Social mediaemoji, blocks
Printdetailed, standard
Code commentssimple, binary

By Size

Output WidthRecommended Palette
Small (< 40)simple, blocks, emoji
Medium (40-100)standard, blocks
Large (> 100)detailed, standard

Advanced: Creating Effective Palettes

Design Principles

  1. Start with space: White/bright areas should be empty or near-empty
  2. Gradual progression: Characters should increase in "visual density"
  3. Consistent width: Stick to single-width or double-width characters (don't mix)
  4. Test visually: What looks dense to humans matters more than technical measurements

Visual Density Order

Common characters ordered by visual density:

Lightest: (space) . · ' ` , - ~ _
Light: : ; ! i l | / \ ( )
Medium: o O 0 c C { } [ ] + = *
Dark: # % @ & $ X W M
Darkest: █ ▓ ▒ (solid blocks)

Testing Your Palette

# Quick test with a gradient image
gummyworm -p "your palette here" -w 60 gradient.png

# Test with color to see mapping
gummyworm -p "your palette" -c photo.jpg

# Compare palettes
for p in standard blocks detailed; do
echo "=== $p ==="
gummyworm -p "$p" -w 40 photo.jpg
done

Troubleshooting

Characters not displaying correctly

  • Check terminal Unicode support: echo "░▒▓█"
  • Try a different font
  • Fall back to ASCII-only palettes: standard, detailed, simple

Emoji showing as boxes or ?

  • Install an emoji font (Noto Color Emoji)
  • Use a terminal with emoji support (iTerm2, Windows Terminal, Kitty)
  • Fall back to non-emoji palettes

Output looks wrong / not enough contrast

  • Try -i (invert) flag for dark images
  • Use blocks palette for more contrast
  • Adjust width: smaller = more detail sometimes

Palette file not found

  • Ensure file is in palettes/ directory
  • File must end with .palette extension
  • Check filename matches exactly (case-sensitive)