A WCAG-compliant alt text generator powered by AI. Upload images or provide URLs to generate accessible, descriptive alt text that follows web accessibility guidelines.
- 🖼️ Image Upload: Drag and drop or select image files (JPG, PNG, GIF, WebP)
- 🔗 URL Support: Generate alt text from image URLs
- 🤖 AI-Powered: Uses Anthropic's Claude 3.5 Sonnet for intelligent image analysis
- ♿ WCAG Compliant: Follows Web Content Accessibility Guidelines 2.1
- 📝 Context Aware: Add additional context to improve alt text quality
- 📚 History: Saves generation history with thumbnails for easy reference
- ✏️ Editable: Click to edit generated alt text inline
- 📋 Copy to Clipboard: One-click copying for easy use
- 🔄 Compare Versions: Compare current and previous alt text versions
- Frontend: SvelteKit 5 with Runes
- Styling: Tailwind CSS
- AI: Anthropic Claude 3.5 Sonnet
- Storage: Browser localStorage for history
- Accessibility: Full ARIA support and keyboard navigation
- Node.js 18+
- pnpm (recommended) or npm
- Anthropic API key
- Clone the repository:
git clone <repository-url>
cd alt-text-generator- Install dependencies:
pnpm install- Set up environment variables:
cp .env.example .env- Add your Anthropic API key to
.env:
ANTHROPIC_API_KEY=your_actual_anthropic_api_key_hereStart the development server:
pnpm dev
# or start the server and open the app in a new browser tab
pnpm dev --openThe application will be available at http://localhost:5173
To create a production version:
pnpm buildPreview the production build:
pnpm preview- Choose Input Method: Select either "Image" to upload a file or "URL" to use an image URL
- Add Image:
- For images: Drag and drop or click to select a file
- For URLs: Enter a valid image URL
- Add Context (Optional): Provide additional context to improve alt text quality
- Generate: Click "Generate Alt Text" to create WCAG-compliant alt text
- Review: Check the character count and quality feedback
- Edit: Click the generated text to edit if needed
- Copy: Use the copy button to copy alt text to clipboard
Generate alt text for an image.
Request Body:
{
"type": "image" | "url",
"data": "base64_image_data" | "image_url",
"context": "optional_context_string",
"previousAltText": "optional_previous_version"
}Response:
{
"altText": "Generated alt text description",
"success": true
}This tool follows WCAG 2.1 Level A guidelines for alt text:
- Concise: Usually under 125 characters
- Descriptive: Conveys essential information
- Context-aware: Considers the image's purpose
- No redundancy: Avoids "image of" or "picture of"
- Meaningful: Describes content, not appearance
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests if applicable
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for Claude AI
- SvelteKit for the framework
- WCAG Guidelines for accessibility standards