Skip to content

Configuration

Sepehr0Day edited this page Jun 13, 2026 · 1 revision

Configuration

CaptchaConfig controls shared visual and output behavior.

from CaptchaGenerator import CaptchaConfig

config = CaptchaConfig(
    width=960,
    height=540,
    output_format="WEBP",
    quality=88,
    background_color="#f8fafc",
    foreground_color="#172033",
    accent_colors=("#ef4444", "#3b82f6", "#22c55e"),
    fonts=("custom.ttf",),
    font_size=42,
    line_width=4,
    padding=32,
    accessibility_text="Accessible challenge description",
    random_seed=42,
)

Visual generators return ChallengeResult with path, answer, prompt, metadata, accessibility_text and mime_type.

Clone this wiki locally