Giter VIP home page Giter VIP logo

alt-text-generator's Introduction

Alt Text Generator

This extension makes it easy to generate descriptive alt-text for images. Simply provide an image URL, and the extension will make a call to the openai api to create a concise and descriptive alt text.

Requirements

This extension is Bring-Your-Own-Key (support for OpenAI only at the moment). If you don't have an API key yet, you can sign up for one at OpenAI - Api Keys. The key is stored locally and securely within VS Code and is scoped to the altTextGenerator extension.

How to Use

You can use the extension in three ways:

From the command palette: Activate the VS Code command palette and type Generate Alt-Text. It will prompt you to provide the image URL in the input box. If it is your first time using the extension, you will also be prompted to enter your OpenAI API key. From Command Palette

From editor selection: Highlight an image URL in the editor and press Ctrl+Shift+P to activate the command palette. Then, select Generate alt text. If the selected text is the opening HTML or React tag, the extension will append an alt attribute with the generated alt-text. From Selection

From file explorer selection: Right-click on an image file in the file explorer and select Generate Alt Text. The extension will generate alt-text for the image and copy it to the clipboard. From File Explorer

Good to know

  • The extension works local images too. If you want to generate alt-text for a local image, you can use the Generate Alt-Text command and provide the relative or absolute path to the image file.
  • Once generated, the alt text is copied to the clipboard, but you can also click Copy to Clipboard in the notification to copy the alt text again.
  • Supported image types and file sizes are determined by the OpenAI API. For more information, refer to the OpenAI API Vision documentation.
  • Reset the API key by running the Reset API Key command from the command palette.

Extension Settings

This extension contributes the following settings:

  • altTextGenerator.prompt: Customize the prompt message that is sent to openai for generating alt-text.
  • altTextGenerator.model: Set the OpenAI model used for generating alt-text. Default is gpt-4-turbo. For a list of available models that understand images, refer to the OpenAI API documentation..

Known Issues

File path resolution for local images is still WIP, so you may run into some issues these. Please report any issues you encounter on the GitHub issues page.

alt-text-generator's People

Contributors

jackcasica avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.