When to invoke
- You maintain a website/app content library and want to improve accessibility.
- You need an audit of missing or low-quality
alttext for images.
Inputs needed
- A JSON export of images with fields:
page,src,alt. - Optional policy: minimum alt length, banned phrases, whether decorative images may be empty.
Workflow
- Validate input records and normalize text.
- Score each image:
- Missing alt
- Empty alt (allowed only if decorative)
- Too short / too long
- Generic alt (e.g., “image”, “photo”, file names)
- Produce a remediation list sorted by severity.
- Summarize coverage and common issues.
Output format
- JSON report:
summarymetricsissues[]with per-image findings and suggested fix hints
Guardrails
- This is a heuristic audit; do not claim WCAG compliance.
- Do not fetch remote images or attempt vision-based descriptions.
Reference code
accessibility_alt_text_auditor.pyreads image metadata JSON and outputs an audit JSON.