AI-Generated Blog Header Images: Alt Text, Size, Style
An AI-generated header image won't hurt your rankings on its own. Google's Gary Illyes put it plainly: "AI generated image doesn't impact the SEO. Not direct." What it can hurt is the page. An image is the Largest Contentful Paint element on 76% of mobile pages, and generators hand you a PNG by default, so the hero you never looked at is often the slowest thing on the page. Three rules fix most of it: write a real alt text, give the image an LCP budget, and lock one style across the feed so your posts look like they came from one publication.
That's the short answer. The rest of this guide is for the indie dev whose pipeline checks every link in the draft, then lets a multi-megabyte image ride along on top without anyone opening it.
The image nobody reviewed
Picture the usual setup. Your AI tool drafts the post, you skim it, fix a claim or two, and merge. The hero came attached, so it went in too. You never checked what it weighs, what its alt says, or whether post #14 looks like it belongs on the same blog as post #3.
It isn't just you. The HTTP Archive's Web Almanac 2025 found that "about 16%-17% of pages lazy-load their LCP image." Roughly one page in six tells the browser to wait before loading its most important picture. The WebAIM Million 2026 audit found missing alt text on 53.1% of home pages, down from 55.5% a year earlier but still more than half.
AI images make both problems easier to create. They arrive instantly, look finished, and nothing about them asks to be reviewed. That's the trap, and it starts with the good news about rankings.
Google doesn't penalize AI images, which is why nobody checks them
The rankings question has a clear answer. Asked whether AI-generated images hurt rankings, Illyes told Kenichi Suzuki "AI generated image doesn't impact the SEO. Not direct." He added two caveats that matter more than the headline. First, "you will have to sacrifice some resources to those images." Second, "you might get some traffic out of image search."
John Mueller said much the same about stock photos years earlier: a non-original image is "not going to harm your site" in web search, and "you wouldn't rank for this in Image Search, but it doesn't count against it either." A generated image has one edge over stock: nobody else has it. That edge only pays off if Google can tell what the image shows, which depends on alt text and the page around it.
One more detail is easy to miss. Google's guidance on generative AI content says the need to check AI output for accuracy "also applies to metadata like" titles, meta descriptions, structured data and "alternate texts for images." If your tool writes the alt text, that alt text is part of what you review.
So there's no penalty, just costs that never show up in a rankings report: bytes, LCP, and readers who can't see the image. Start with the one that costs nothing to fix.
Rule 1: Write a real alt text (or an honest empty one)
Google's Image SEO best practices call alt text "the most important attribute when it comes to providing more metadata for an image." Google reads it "along with computer vision algorithms and the contents of the page." The same page warns: "Avoid filling alt attributes with keywords," because doing so "may cause your site to be seen as spam." Its example ladder runs from missing alt, to a keyword list, to alt="puppy", to the best version: alt="Dalmatian puppy playing fetch".
That ladder is written for informative images, though. A hero image often isn't one, and that's where most of the confusion comes from.
Decorative or informative? Only you can decide
The W3C's decorative images tutorial covers images that are "Illustrative of adjacent text but not contributing information ('eye-candy')." Those get alt="", an empty attribute that tells screen readers to skip the image. Leaving the attribute out entirely is worse, because "some screen readers will announce the file name of the image instead." Your reader then hears hero-final-v3-upscaled.png read out letter by letter. The tutorial also says whether an image is decorative "is a judgment that only the author can make."
That last line matters, because the obvious shortcut ("heroes are decorative, ship alt=""") has been tried and rolled back. In 2018 the Canadian Digital Service treated its blog hero images as "decorative" or "ambient" and left out alt text. After feedback on GitHub, the team ran informal user testing. People preferred a brief description even for ambient images, except for purely decorative ones like gradients, so CDS decided "to add alternative text for these images." Their summary still holds: "No automated testing process or tool will be able to make that distinction for you."
WebAIM gives the most useful test: "if I could not use this image, what would I put in its place?" If the answer is nothing, use alt="". If the answer is a few words, those words are your alt text. WebAIM also notes that "Algorithms alone cannot understand what an image means within the context of the overall page." The same photo can need different alt text depending on what surrounds it. Their example is a photo of astronaut Ellen Ochoa: with a visible caption naming her, the image gets alt="", and without the caption it gets alt="Astronaut Ellen Ochoa".
For an AI hero, that gives you a simple rule:
- The hero shows something the post discusses (a UI, a chart, a specific object). Describe that thing in a few words.
- The hero is atmosphere.
alt=""is honest and correct. One short descriptive line is the friendlier choice, following what CDS learned. - In every case: never omit the attribute, never paste the generation prompt, never start with "image of" (screen readers already announce it's a graphic), and never write a keyword list.
Three rewrites for a typical AI hero
Take the kind of hero this blog uses, young plants on a greenhouse bench, under three alt texts:
| Alt text | Verdict |
|---|---|
alt="photorealistic seedlings in terracotta pots, greenhouse, golden hour, 85mm, shallow depth of field, ultra detailed, 8k" |
The prompt pasted in. A screen reader reads out camera settings, and Google sees something close to a keyword list. |
alt="Seedlings in terracotta pots on a sunlit greenhouse bench" |
Short and concrete, and it describes the image rather than the prompt. A good default for an atmospheric hero you choose to describe. |
alt="" |
Honest if the image adds nothing beyond mood. Not a fallback for "I didn't get to it." |
The prompt-as-alt version isn't hypothetical. WebAIM found that 10.8% of images that do have alt text have questionable or repetitive alt text: file names, generic labels like "image", or text copied from nearby. An unedited generation prompt fails the same way.
Don't forget the second alt slot
The hero usually travels twice: once in the <img> tag, and again as your og:image when someone shares the post. The Open Graph protocol says that "If the page specifies an og:image it should specify og:image:alt," and defines it as "A description of what is in the image (not a caption)." This is where alt="" stops being an option. A share card shows up in a feed with none of the page around it, so og:image:alt needs real words even when the on-page alt is empty.
If you build with Astro, the framework already pushes you this way: its <Image /> component requires alt and documents alt="" as the choice for decorative images, so skipping the decision isn't an option. The next fix is the one that shows up in field data.
Rule 2: Give the hero an LCP budget
Largest Contentful Paint is "good" at 2.5 seconds or less and "poor" above 4.0 seconds, measured at the 75th percentile of page loads. Per the Web Almanac, an image is the LCP element on 85.3% of desktop pages and 76% of mobile pages. Only 62% of mobile pages reach a good LCP, against 74% on desktop. On a typical blog layout the hero sits at the top, fills the width, and is the largest thing in view, so it's usually the LCP.
Usually, not always. web.dev notes that the size used for LCP is "typically the size that's visible to the user within the viewport," so on a narrow phone a 16:9 hero below a long title can lose to the title-and-intro text block. Check which element is the LCP in DevTools or PageSpeed Insights before you optimize.
Generators give you PNGs
OpenAI's image API states that "The default format is png, but you can also request jpeg or webp," with an output_compression setting (0–100%) for JPEG and WebP. It even notes that "Using jpeg is faster than png, so you should prioritize this format if latency is a concern." Most pipelines never set either parameter, so the PNG goes straight into the repo.
The Web Almanac 2024 media chapter shows why that matters. Median bits per pixel on mobile were 3.8 for PNG, 2.0 for JPEG, 1.4 for AVIF and 1.3 for WebP, so in the wild a PNG spends nearly three times the bits of a WebP for each pixel. Google's WebP page puts lossless WebP 26% smaller than PNG. AVIF and WebP land close together in that field data, so pick whichever your pipeline supports; both beat PNG by a wide margin.
The clearest real-world case is a WordPress blog with 139 AI-made featured images, all PNG. They averaged 2.7 MB each, the largest 8.3 MB, roughly 168 MB in total. Converting them with cwebp at quality 90 brought the set to about 12 MB, around 100 KB per image. The author, Hannah Vernon, judged Q90 "visually indistinguishable from the PNG original." That's an eyeball judgment, not a lab metric, and the post doesn't measure LCP. The scale of the change is still hard to argue with.
The arithmetic on a throttled phone
Here's what those two sizes mean for a reader. Lighthouse's mobile throttling preset, the same setup PageSpeed Insights uses, assumes 150 ms of latency and 1.6 Mbps of download.
- A 2.7 MB PNG is about 21.6 megabits, roughly 13.5 seconds of transfer at 1.6 Mbps.
- A 100 KB WebP is about 0.8 megabits, roughly 0.5 seconds.
That's transfer time alone, before latency, HTML parsing and render work. But the "good" LCP threshold is 2.5 seconds in total. The PNG hero has used that budget five times over before anything else happens. The WebP leaves room for everything else.
For a budget, the 2024 Almanac gives a useful benchmark: the median largest image on a mobile page was 135 KB. Aim for your hero to land at or under that. The 139-image conversion landed around 100 KB at Q90, so the target is realistic for typical AI output.
A one-off conversion is a single command:
cwebp -q 90 hero.png -o hero.webp
Or skip the PNG entirely by requesting WebP or JPEG output from the API with output_format and output_compression set.
Loading: two attributes do most of the work
A light file can still load late. The web.dev LCP optimization guide is blunt: "never" put loading="lazy" on the LCP image. It recommends adding fetchpriority="high" to the expected LCP <img>, but not on "more than one or two images." On Google Flights, adding fetchpriority="high" to the LCP image moved LCP from 2.6 s to 1.9 s. One attribute took the page from "needs improvement" to "good." Adoption is still low: the 2025 Almanac found fetchpriority="high" on 17% of mobile pages with LCP images.
Add width and height too. web.dev's CLS guidance says to "Always include width and height size attributes on your images" so the browser reserves space and the text doesn't jump when the hero arrives. In plain HTML, a hero that follows all of the above looks like this:
<img src="/img/hero-1600.webp"
srcset="/img/hero-800.webp 800w,
/img/hero-1200.webp 1200w,
/img/hero-1600.webp 1600w"
sizes="(max-width: 800px) 100vw, 800px"
width="1600" height="900"
alt="Seedlings in terracotta pots on a sunlit greenhouse bench"
fetchpriority="high">
The framework gotcha
Here's where a static-site default can work against you. Astro's image docs show a plain <Image /> rendering with loading="lazy" and decoding="async". That's right for images further down the page and wrong for the hero. Astro 5.10 added a priority prop that sets loading="eager", decoding="sync" and fetchpriority="high" in one go. The docs also describe layout="full-width" as intended for hero images, with srcset and sizes generated for you:
<Image src={hero} alt="Seedlings in terracotta pots on a sunlit greenhouse bench"
layout="full-width" priority />
On Next.js or Hugo, check the rendered HTML rather than trusting a prop name. Chrome DevTools' LCP request discovery insight checks exactly three things: fetchpriority=high is applied, the image is discoverable in the initial HTML, and it isn't lazy-loaded. The Improve image delivery insight flags files that are heavy for their format and warns that you "should never serve images that are larger than the version that's rendered on the user's screen."
Don't shrink too far
There's a floor, too. Google Discover wants images at least 1200 px wide with more than 300,000 total pixels (1280×720 qualifies), preferably 16:9, plus the max-image-preview:large setting, and no logos or text-heavy images. A sensible target: a 16:9 WebP around 1200–1600 px wide, served through srcset so phones get a smaller copy, near that 135 KB benchmark.
That covers one post. But your heroes will be seen side by side on the index page, so the last rule is about the set.
Rule 3: Lock one style across the feed
Open your /blog index and look at the thumbnails in a row. If post #3 is a watercolor fox, post #8 a glossy 3D robot and post #14 a photoreal office, the feed reads like unrelated posts rather than one publication. To be fair, there's no published case study of a blog that locked one generated style across its feed and measured the result, so this rule rests on design judgment and tool documentation, not a benchmark. Anyone landing on your index still notices the difference.
The tools for locking a style exist, and they have limits. Midjourney's --sref (style reference) carries over color, medium, texture and lighting, not subjects. Its weight, --sw, runs from 0 to 1000 with a default of 100. Style codes are also tied to specific model versions, so a style you've locked can break when the model updates. Google's Nano Banana Pro accepts up to three images as style references.
A hands-on test shows where these break. Christy Tucker ran --sref across a set of images and found that the color scheme and general style carried over, "though… the style wasn't always consistent." Realism and detail "noticeably decreases when the images include multiple people or objects," and saturation drifted across her icon set. Her conclusion was still positive: fixing the drift took less time than hunting for stock. The practical lesson is to keep the motif simple and stick to one subject per image.
Write the visual spec down
The fix is the same one that works for text: write the spec down instead of describing a mood. Our guide to brand voice guidelines an AI can actually follow makes this case for prose. Adjectives don't steer a model; concrete rules and examples do. A visual spec for heroes needs five lines:
- Motif. One recurring subject family (this blog's is seedlings on a greenhouse bench).
- Palette. Two or three named accent colors on a consistent ground.
- Light. Direction and time of day, for example low warm light from the left.
- Frame. A fixed aspect ratio (16:9) and a single-subject composition.
- Exclusions. What never appears: text, logos, faces, and the usual AI clichés.
That last line deserves a note. Better Images of AI, a non-profit project, argues against "shiny humanoid robots," "electronic representations of human brains" and "sci-fi inspired and anthropomorphised images," which it says reinforce misconceptions about AI. Those are exactly what many tools attach by default to a post about AI.
Reader trust points the same way. A Getty Images survey of 30,000+ adults in 25 countries found almost 90% want to know whether an image was AI-created, and that AI images of non-human subjects were seen as less misleading than AI images of people or real products. Getty sells stock imagery and the fieldwork ran 2022–2023, so weigh it accordingly. The takeaway still holds: a still life is safer than a photoreal "customer" who doesn't exist.
This is also where an automated pipeline can help. Magic Share builds a brand profile from your site so drafts keep one voice, and a draft can ship with a generated hero image alongside the text when you ask for one. That makes your written visual spec something you check at review time, not something you remember occasionally.
The provenance footnote: what your converter strips
One side effect of Rule 2 is worth knowing about. Many AI images carry provenance data: C2PA metadata that says the image was AI-generated. OpenAI added C2PA to DALL·E 3 output back in 2024 and noted at the time that the metadata can be removed. The usual compression step removes it. sharp, which sits under many static-site image pipelines, states: "By default all metadata will be removed." cwebp defaults -metadata to none. CDNs did the same: Cloudflare found Content Credentials "would frequently be stripped" by image transforms, and added a "Preserve Content Credentials" toggle.
What survives is the pixel watermark. Google says "All generated images include a SynthID watermark" for its Gemini image models. In May 2026 OpenAI partnered with Google to embed SynthID in its outputs, a watermark designed to persist "through screenshots, resizing, compression." The same month, Google expanded SynthID verification to Search, with C2PA checks coming to Search and Chrome "in the coming months."
For a blog this is disclosure hygiene, not a ranking issue. On the legal side, EU AI Act Article 50 applies from 2 August 2026: providers must mark AI output in machine-readable form, and deployers must disclose deep fakes, content resembling real people or events that "would falsely appear" authentic. A stylized seedling isn't a deep fake; a photoreal fake event photo might be (this isn't legal advice). If you want to be upfront, a visible credit line beats metadata your build step deletes. For the wider question of labeling AI-assisted work, see our post on whether you need to disclose AI-written content.
A pre-merge checklist for every hero image
If you publish through pull requests, the image belongs in the review just like the prose does. Here's the check, in the order you'd run it on a preview deploy:
- Alt attribute present. Either a few concrete words describing the image, or
alt=""for pure atmosphere. No prompt, no "image of", no keywords. og:image:altfilled with a real description, even when the on-page alt is empty.- Format is WebP, AVIF or JPEG, not the generator's default PNG.
- Weight near or under ~135 KB for the largest
srcsetcandidate a phone will fetch. - Width at least 1200 px at 16:9 for Discover, with smaller sizes in
srcset. widthandheightset (or a CSSaspect-ratio) so nothing shifts.- No
loading="lazy";fetchpriority="high"present (Astro:priority). - DevTools confirms it: which element is the LCP, and whether LCP request discovery passes.
- Matches the visual spec: motif, palette, light, frame, no exclusions.
Most of it takes a few minutes once it's routine. If you've already built a text pass, such as the 10-minute edit that makes AI drafts sound human, this is the image-side equivalent: one more short pass in the same review.
FAQ
Do AI-generated images hurt SEO?
Not directly, according to Google's Gary Illyes. The indirect costs are real: an unoptimized PNG hero can push LCP well past 2.5 seconds, and missing alt text costs accessibility and Image Search visibility.
What alt text should I write for an AI blog header image?
A few concrete words describing what it shows, such as "Seedlings in terracotta pots on a sunlit greenhouse bench." For pure atmosphere, alt="" is acceptable. Never paste the prompt or a keyword list, and never omit the attribute.
How big should a blog hero image be?
1200–1600 px wide at 16:9 (Discover's minimum is 1200 px), in WebP or AVIF, near the 135 KB median for a mobile page's largest image, with smaller copies in srcset.
Should I lazy-load the hero image?
No. web.dev says never to lazy-load the LCP image, and the hero usually is the LCP. Use fetchpriority="high", or priority on Astro's <Image />.
Does converting to WebP remove the AI label from my image?
The metadata, usually yes: sharp and cwebp strip it by default, C2PA included. SynthID watermarks live in the pixels and are designed to survive compression. For honest disclosure, add a visible credit line.
Ship the image like you ship the words
A generated hero image is the first thing a reader sees, the element their phone waits on, and what represents your post in every share card. It deserves the same review as the claims in the text: a real alt text, a byte budget the LCP can live with, and a style that makes your feed look like one publication.
Magic Share drafts each post with its sources verified and, if you want one, a hero image attached, and nothing publishes until you approve it. Your merge is still the publish button, so the checklist above fits right into that review. Your first three posts are free; see the plans and start with a free site.