How to AI a Picture: A Practical Step-by-Step Guide
"How to AI a picture" usually means one of two things: you want an AI tool to transform, stylize, or generate a new image from one you have, or you want AI to look at a picture and tell you something about it — describe it, extract text from it, or classify what's in it. Both are common, and the right approach depends entirely on which one you actually need.
If you're doing this once or twice, a consumer app is the fastest path. If you need it to happen automatically, at scale, or as part of a larger workflow (an app, a script, a content pipeline), you want an API that accepts images as input. This guide covers both, with concrete steps for each.
Method 1: Transforming or Generating a Picture with AI (One-Off Use)
If you want to turn a photo into a painting-style image, generate a new picture based on a prompt, or produce variations of an existing image, the fastest route is a standalone AI image tool. The general workflow looks like this:
- Pick a tool that supports image-to-image or text-to-image generation.
- Upload your source picture (if you're transforming an existing one) or write a text prompt (if you're generating from scratch).
- Add a style or instruction — "oil painting," "cyberpunk," "remove background," "make it look like a pencil sketch."
- Generate and review — most tools give you several variations per run.
- Download the result in the resolution you need.
This works fine for social media posts, mockups, or personal projects. It doesn't work well if you need to process hundreds of images automatically, need consistent output formatting, or need to integrate the result into another piece of software. For that, you need an API.
Method 2: Having AI Analyze a Picture (Programmatic Use)
The other common meaning of "AI a picture" is getting AI to understand an image rather than generate one — read the text in a screenshot, describe a photo for alt text, check whether an image matches a description, or extract structured data from a scanned document.
This is done through a vision-capable model API. The steps are the same regardless of which provider you use:
- Get an API key.
- Encode your image (usually base64, or provide a URL).
- Send a request with the image and a text instruction describing what you want back.
- Parse the response.
Here's what that looks like using SubToAPI, which exposes Claude's vision capability through a standard REST endpoint with an sub_live_... API key:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4",
"max_tokens": 500,
"messages": [
{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": "'"$(base64 -i picture.png)"'"
}
},
{
"type": "text",
"text": "Describe what is in this image in one paragraph, then list any visible text."
}
]
}
]
}'
The same thing in JavaScript:
import fs from "fs";
const image = fs.readFileSync("picture.png").toString("base64");
const response = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"content-type": "application/json"
},
body: JSON.stringify({
model: "claude-sonnet-4",
max_tokens: 500,
messages: [
{
role: "user",
content: [
{
type: "image",
source: { type: "base64", media_type: "image/png", data: image }
},
{ type: "text", text: "What objects and text are visible in this picture?" }
]
}
]
})
});
const data = await response.json();
console.log(data);
This pattern scales cleanly — swap the file in a loop and you can process a whole folder, a batch of user uploads, or an incoming stream of screenshots. Full request and response details are in the messages docs, and streaming output for longer analyses is covered in the streaming docs.
Choosing the Right Approach for Your Use Case
A quick way to decide which path fits:
- You want a stylized or generated image, one at a time → use a consumer image tool.
- You want AI to read, describe, tag, or extract data from images automatically → use a vision API.
- You're building a feature into a product (alt-text generation, receipt scanning, content moderation, image-based support tickets) → use a vision API with proper error handling and rate limits.
- You need this to run unattended, on a schedule, or on user-submitted content → API, not a manual tool.
If you already have a Claude subscription and just need programmatic access without dealing with separate API billing, SubToAPI turns that access into an application key you can drop into any script or backend. Setup takes a few minutes — the quickstart walks through generating your first key and sending a test request.
Common Practical Uses for AI-Processed Pictures
- Generating alt text for accessibility compliance
- Extracting line items from receipts or invoices
- Flagging inappropriate or off-brand images before publishing
- Summarizing chart or diagram content from a screenshot
- Converting handwritten notes into typed text
- Verifying that a user-uploaded photo matches expected content (e.g., a valid ID format)
Each of these is the same core request pattern shown above — image in, instruction in, structured text out.
Questions
Does "AI a picture" mean generating an image or analyzing one? It can mean either. If you want a new or stylized image, use a generation tool. If you want AI to understand or describe an existing image, use a vision-capable API.
Can I do this without writing code? Yes, for generation — most consumer AI image tools require no code. For analysis at scale or integration into an app, you'll need to make API calls, even if it's just a short script.
What image formats work with vision APIs? PNG and JPEG are widely supported. Check the specific API's docs for size limits and supported media types before sending requests — see /docs/messages for exact constraints.