Alternative Text Creation Assistance Tool
An AI-powered tool for automatic generation and culture-aware translation of image alternative text to improve web accessibility.
AltCAT automates the creation of image alternative text to comply with Web Content Accessibility Guidelines (WCAG).
- π Statistics: Over 70% of websites have missing or inadequate image alternative text
- βΏ Web Accessibility: Visually impaired users rely on screen readers that read alt text to understand images
- π Multilingual Support: Global services require appropriate alt text in each language
- Auto-generation: Simply enter a URL to analyze all images on the page and automatically generate accessible alt text
- AI Classification: Automatically categorizes images as Informative/Functional/Decorative following W3C guidelines
- Culture-aware Translation: Uses GPT-4.1 Vision API to actually 'see' images and provide culturally contextual translations, not just literal translations
- Production Ready: Download HTML with updated alt text for immediate deployment
- π€ GPT-4.1 Vision API based image analysis
- π Multilingual Support: English, Korean, Chinese, Spanish
- π― W3C Guidelines compliant image type classification
- βοΈ Real-time editing and comparison interface
- π URL History Management (up to 5 URLs)
- π₯ HTML Download for production deployment
- Node.js v23.3.0 or higher
- Python 3.11 or higher
- OpenAI API Key (for GPT-4.1 Vision API)
- Tavily API Key (for culture-aware translation with web search)
git clone git@github.com:snuhcc/AltCAT.git
cd AltCATconda create --name altcat python=3.11
conda activate altcatpip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your_openai_api_key_here
TAVILY_API_KEY=your_tavily_api_key_hereHow to get API Keys:
- OpenAI API Key: https://platform.openai.com/api-keys
- Tavily API Key: https://tavily.com/ (Sign up for free)
cd backend/app
uvicorn main:app --reloadβ Backend server runs at http://127.0.0.1:8000
- Visit http://127.0.0.1:8000 to see the welcome page
- Visit http://127.0.0.1:8000/docs for Swagger UI
- Click "Try it out" to test API endpoints
Open a new terminal window:
cd front
npm installnpm run devβ Frontend runs at http://localhost:3000
Open your browser and navigate to http://localhost:3000
Error Message:
ImportError: cannot import name 'cairosvg'
OSError: dlopen() failed to load a library: cairo
Solution (macOS):
-
Install Cairo:
brew install cairo
-
Set Environment Variables:
Edit your shell configuration file:
vi ~/.zshrc # or ~/.bashrc
Add these lines:
export PKG_CONFIG_PATH=$(brew --prefix cairo)/lib/pkgconfig:$PKG_CONFIG_PATH export PATH=$(brew --prefix cairo)/bin:$PATH export DYLD_LIBRARY_PATH=$(brew --prefix cairo)/lib:$DYLD_LIBRARY_PATH
Apply changes:
source ~/.zshrc # or source ~/.bashrc
-
Reinstall Python Dependencies:
pip install -r requirements.txt
Solution (Ubuntu/Linux):
sudo apt-get install libcairo2-dev
pip install -r requirements.txtReference: https://cairosvg.org/documentation/
When you run the program, you'll see three main areas:
-
Left Sidebar (Dashboard)
- πββοΈ User Profile (Bob)
- π URL History (displays up to 5 URLs)
- π¨ Current URL is highlighted in orange
- π© Language flags next to each URL showing supported languages (πΊπΈπ°π·π¨π³πͺπΈ)
- < button: Hide/Show Sidebar
-
Top Bar
- π URL Input Field
- π© Language Selection Dropdown (click flag icon)
- β Submit Button
-
Main Area
- π Image Card List (left, scrollable)
- πΌοΈ Webpage Preview (right)
-
Starting Screen
- Default URL is already entered (https://assets25.sigaccess.org/) - Language is set to English (πΊπΈ) -
Click Submit
β¨ What happens: - Loading indicator appears - Backend parses the webpage and extracts all images - GPT-4.1 Vision API generates alt text for each image - When complete, image cards appear on the left -
Review Results
Each image card displays: - πΌοΈ Image Thumbnail - π Original Alt Text: The existing alt text from the webpage - π€ Image Type: AI-classified image type β’ Informative: Images that convey information β’ Functional: Buttons/links with functional purposes β’ Decorative: Ornamental images - β¨ AI Generated: New alt text generated by GPT-4.1 - π Context: Surrounding text context of the image -
Check Sidebar
- The analyzed URL is added to the left Sidebar - Current page is highlighted in orange - Supported language flag (πΊπΈ) is displayed
-
Change URL
- Enter a new URL in the top input field - Or click an existing URL in the Sidebar -
Click Submit
β¨ What happens: - Full analysis process repeats for the new URL - New URL is added to Sidebar history (maintains up to 5 URLs) - Previous URLs turn gray, current URL stays orange -
Switching History
π‘ When you click a previous URL in the Sidebar: - Instantly switches to that URL's analysis results - Shows cached data without re-analysis - Enables quick comparison between multiple pages
-
Analyzing Same Page in Different Language
Example: When you want to translate an English page to Korean a) Keep the same URL b) Click flag icon at the top β Select π°π· Korean c) Click Submit -
Check Results
β¨ What happens: - Parses the Korean version of the same URL - Original Alt Text displays in Korean - AI Generated remains in English (master data) -
What If the Language Page Doesn't Exist?
π If there's no Korean version of the webpage: - The system automatically falls back to English page - Original Alt Text remains in English - You can still use AI translation to generate Korean alt text - Language flag for that URL in Sidebar shows only πΊπΈ (no π°π·) -
Culture-Aware Translation
π Click "Translate to Korean" button: - "Culture Aware Alt Text" section appears on each image card - Provides culturally contextual translation, not literal translation - Example: US Flag image β’ Literal: "Flag of the United States" β’ Culture-aware: "Stars and Stripes (US National Flag)" -
Sidebar Language Display
- Language flags appear next to each analyzed URL - Example: https://example.com πΊπΈπ°π· β This page has been analyzed in both English and Korean - Example: https://example2.com πΊπΈ β This page only has English version (Korean page doesn't exist)
-
Direct Editing
- Click "Customized Alt Text" input field on each image card - Modify to your desired alt text - Changes are automatically saved -
Language-Specific Editing
π‘ Important: Edits apply only to the current language Example: - Edit in English (πΊπΈ) mode β Saves to English version only - Switch to Korean (π°π·) mode and edit β Saves to Korean version only - Manage different alt text for each language independently -
Download HTML
- Click "Download Updated HTML" button at the bottom - Downloads HTML file with your updated alt text - Ready for production deployment
-
Analyze Multiple URLs
- Enter URL 1 β Submit β Review results - Enter URL 2 β Submit β Review results - Enter URL 3 β Submit β Review results -
Quick Switching in Sidebar
- Sidebar displays up to 5 URL history - Switch between pages with a single click - Each page's analysis results are cached for instant display -
Identifying Current Page
- Current page is highlighted in orange - Prevents confusion when working with multiple pages
-
Automation Convenience
"Simply enter a URL and the system automatically analyzes all images on the page" -
AI Accuracy
"GPT-4.1 Vision API actually 'sees' the images and generates contextually appropriate alt text" -
Cultural Context Consideration
"Provides natural translations that reflect cultural characteristics, not just literal translations" -
Production Ready
"Download updated HTML and immediately deploy to your actual website"
-
Loading Time
- Pages with many images take time to analyze - May take 30 seconds to 1 minute due to multiple API calls - Explain: "AI is analyzing each image individually" -
Language Selection Timing
β οΈ Important: Select language BEFORE clicking Submit - Wrong order: Submit β Change language (β) - Correct order: Select language β Submit (β ) -
CORS Errors
- Some websites cannot display iframe due to security policies - Explain: "Webpage preview may not display due to security policies, but the important part is the image analysis results on the left, which work perfectly" -
When Language Version Doesn't Exist
- If selecting Korean for an English-only website: - System automatically falls back to English page - Explain: "This website only has an English version. The Original Alt Text remains in English, but we can still use AI translation to generate culturally appropriate Korean alt text" - Check Sidebar: Only πΊπΈ flag appears (no π°π·)