How to Rename Images for SEO with AI (The Right Way)
Learn how to rename images for SEO using AI — automatically generate descriptive filenames and alt text that help Google rank your pages.
Why image filenames are an SEO signal
When Googlebot crawls your page, it processes every asset — including images. It can't "see" an image the way a human can, but it can read:
Google's own documentation confirms: "The filename can give Google clues about the subject matter of the image." That's not a suggestion — it's a ranking signal you're leaving on the table every time you upload an unedited camera file.
For Google Image Search specifically, descriptive filenames directly increase your chances of appearing. Image search drives a non-trivial percentage of traffic for product pages, recipe blogs, travel sites, and editorial content. Most site owners never tap it because their filenames are garbage.
What makes an image filename SEO-friendly
Good SEO filenames follow a consistent set of rules. None of them are complicated — the challenge is applying them at scale.
Use hyphens, not underscores. Google treats hyphens as word separators. golden-retriever-puppy.jpg is read as three separate words. golden_retriever_puppy.jpg is read as one long token. This has been confirmed by Google's John Mueller repeatedly — use hyphens.
Be descriptive, not keyword-stuffed. A filename like buy-cheap-seo-golden-retriever-puppy-dog-photo.jpg is both spammy and unhelpful. The sweet spot is 3–6 words that accurately describe the image content. golden-retriever-puppy-playing-grass.jpg is ideal.
Include your target keyword where it fits naturally. If you're writing a blog post about golden retrievers and optimizing images for that post, your primary keyword should appear in at least one or two image filenames — naturally, not forced.
Keep it lowercase. Always. Mixed-case filenames can cause duplicate content issues on some servers and are harder to read in source code.
Match the filename to the page context. An image of a pricing table on a SaaS landing page shouldn't be named photo1.jpg. It should be named something like saas-pricing-table-comparison.jpg — relevant to both the image content and the page topic.
The problem with manual renaming at scale
For a single image, renaming is trivial. For a blog post with 8 images, it's annoying but doable. For an e-commerce site with 3,000 product photos, it becomes a full-time job.
Even at small scale, most people skip it — because it interrupts the workflow. You finish editing a post, you upload your images, and you're done. Going back to rename each one before uploading requires opening Finder, batch renaming, keeping the context in mind for each image, then re-uploading. Almost nobody does it consistently.
This is exactly the gap that AI fills.
How AI image renaming works
AI image renaming uses a vision language model (VLM) — a type of AI that can analyze the visual content of an image and produce text descriptions. The most capable models for this use case in 2026 are Google Gemini (Flash and Pro) and OpenAI's GPT-4o.
The process is straightforward:
The quality of the output depends heavily on the prompt. A well-crafted prompt asks the model to return a filename that is: descriptive, 3–6 words, lowercase, hyphenated, and relevant to the dominant subject of the image. SammaPix uses Gemini 1.5 Flash with a tuned prompt specifically designed for SEO filenames — not generic image descriptions.
How to rename images for SEO with SammaPix
SammaPix's AI Rename feature is built into the core compression workflow, so renaming and optimizing happen in a single step.
Step 1. Go to sammapix.com and upload your images. SammaPix accepts JPG, PNG, and WebP. You can upload multiple files at once.
Step 2. Sign in with Google or GitHub. AI Rename requires a free account — this prevents API abuse and keeps the service free for everyone. Sign-in takes about 10 seconds and you never need to create a password.
Step 3. Toggle AI Rename on in the settings toolbar. You'll see a small AI badge appear on each file card.
Step 4. Adjust your compression settings if needed — quality level, output format. Select WebP if you want it (you almost always should for web use).
Step 5. Click Compress all. SammaPix compresses each image and simultaneously sends a thumbnail to Gemini Flash for analysis. The AI-generated filename appears on the card within 1–2 seconds.
Step 6. Review the suggestions. You can click any filename to edit it manually before downloading — useful when the AI gets the general description right but misses a specific product name or brand term.
Step 7. Download your files individually or as a ZIP. The files already have the SEO-optimized names applied.
Everything — compression, WebP conversion, renaming — happens without your images ever leaving your browser for the compression step. For AI rename, only a small compressed thumbnail is sent to Google's API, never the full-resolution file.
Alt text: the other half of image SEO
Renaming the file is step one. Writing good alt text is step two, and most guides conflate the two or skip one entirely.
Alt text serves two purposes:
Good alt text is a sentence, not a filename. Where a filename might be barista-pouring-latte-art.jpg, the alt text should be something like "A barista pouring steamed milk into an espresso to create a heart-shaped latte art design" — complete, descriptive, natural.
Rules for alt text:
SammaPix's AI Rename generates suggested alt text alongside the filename. You can copy it directly into your CMS.
Image SEO checklist before publishing
Before hitting publish on any page with images, run through this list:
Doing this consistently will compound over time. It's a repeatable system, not a one-time fix.
FAQ
Does Google actually use image filenames as a ranking factor?
Yes — Google's official documentation on image SEO states that filenames provide context about an image's subject matter. It's not a primary ranking factor like backlinks or content quality, but it's a real signal, especially for Google Image Search. The incremental effort of using good filenames is almost zero (especially with AI automation), so there's no reason not to.
Can I rename images after they've already been indexed by Google?
You can, but it requires care. If you rename an image that's already indexed, the old URL returns a 404, which breaks any Image Search rankings you'd accumulated. The correct process: rename the file, update all src references on the page, and add a 301 redirect from the old filename URL to the new one. For large-scale renaming, consult your server logs before making changes.
What's the difference between a filename and a URL slug for images?
The filename is what you call the file locally and what gets used in the src attribute. In most setups, improving the filename directly improves the URL. The one exception is if you're using a CDN that rewrites asset URLs — in that case, the filename still influences the alt text and your CMS metadata, but the CDN URL may differ.
Share this article
Try SammaPix free
Compress, convert to WebP, and AI-rename your images — no signup needed for compression. 100% client-side, images never leave your browser.
Start optimizing