I'm Too Lazy to Write Alt Text, So Gemma Does It For Me
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady What I Built Every codebase I've touched has the same line in it: <img src= "/imgs/cookie.png" alt= "" /> It's rarely because we don't care about accessibility. Describing forty images is just the most boring job in front-end, so it gets pushed to "later." So I built a VS Code extension that does it for…
This story details the creation of a VS Code extension that automatically generates alternative text (alt text) for images in HTML, JSX, and TSX files using a locally installed Ollama vision model. The author, Gemma, built the extension because manually describing images can be tedious and easily neglected in codebases. The extension provides a convenient way to generate alt text by hovering over an image, clicking a button, or running a command to fill in all missing alt text at once.
The extension ensures that existing alt text is never overwritten and handles both local image paths and remote URLs. It runs entirely on the user's machine, keeping image content secure and avoiding costs associated with hosted APIs. The extension supports various image formats and allows users to swap in different vision models if desired.
The author emphasizes the benefits of using a local model for privacy, cost-efficiency, and flexibility compared to hosted solutions. In a test, the extension processed 20 images in about 3 minutes, compared to roughly 10 minutes of manual work, with 18 out of 20 descriptions needing no edits.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.