Urgent.News

What's breaking now, across thousands of outlets.

Tech

altcheck: draft alt text and contrast fixes with a local open vision model

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission ๐Ÿ’ธ This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle What I Built altcheck is a small command-line tool for freelance web developers. Give it one URL and it writes a local report.html . Images with a missing, filename-style or generic alt get a drafted alt text. Text that fails theโ€ฆ

altcheck: Creating Draft Alt Text and Contrast Fixes with a Local Open Vision Model

altcheck is a command-line tool designed for freelance web developers. When given a URL, it generates a local report.html that addresses images with missing, filename-style or generic alt text, as well as text that fails the color-contrast check. The tool provides drafted alt text and suggested color fixes, but it does not edit the site or perform full accessibility checks.

The tool is aimed at freelancers or small agencies who want to quickly improve the accessibility of client pages. Running it over a webpage and fixing obvious gaps can take mere minutes, making it a potential paid service for quick accessibility upgrades. The developer has not yet shown the tool to clients or paying users.

The demo video, available in the repository, showcases the tool's performance on a deliberately inaccessible W3C demo page. Three images with no alt text were examined, and the drafted alt texts matched the visible content. The page also contained two contrast failures.

To achieve its functionality, altcheck uses Playwright to load the page, axe-core to run the color-contrast rule, and a Python function to adjust text colors until they meet the requirement. For image processing, the SmolVLM-500M-Instruct model (released under Apache 2.0) runs locally via transformers. It generates a short sentence for each image and determines if the image appears decorative. Images with missing or empty alt attributes are handled differently, as an empty alt is valid for purely decorative purposes.

The tool's development process involved modifying the initial approach, which sent the model the surrounding page text and link details. This caused the 500M model to copy text or invent content, so the current implementation only provides the nearest heading and adds the link destination through code. Due to memory constraints on a 2-core CPU with 2 GB of RAM, the tool uses bfloat16 instead of float32, resulting in approximately 20 seconds of processing time per image. The tool has not been tested on GPUs, Apple Silicon, Windows, other models, or various real sites.

Six unit tests cover image selection, contrast math, and report escaping. Open innovation matters in this context because client pages are often unreleased or private. Using an open-weight model on the freelancer's own machine eliminates the need for image uploads to an API and removes per-image fees. The model's prompts are transparent, allowing anyone to swap in another open-licensed model using the --model command.

Additionally, the drafts generated by the tool are of small-model quality, and the report advises a review before using the suggestions. The chosen SmolVLM model is licensed for commercial use, making it suitable for a paid tool that requires no image upload fees.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

A Colleague Wants Your Notes on Their Talk Before Thursday

A colleague has a talk at a meetup on Thursday evening. On Tuesday they ask if you would watch a run through and tell them what you think.

  • Colleague requests notes and feedback on Thursday talk, with only two days to improve.
  • Audience engagement observation is crucial; avoid reading from slides.
  • Focus feedback on three key points, prioritizing time management and clarity.

Make an order-dependent test reproducible before handing it to a coding agent

This tutorial was drafted with AI assistance. Its small JavaScript fixture was executed locally; it is not a production incident report.

  • Reduce issue to two individual tests: warming service and verifying empty fixture
  • Save tests in JavaScript file and execute with Node.js
  • Run tests in warm-cold and cold-warm orders to detect state leakage

More from Wednesday 14 October โ†’