ScreenshotNeo

BlogGuides

Image Management Best Practices for Websites

Build a reliable website image workflow: choose formats, write useful alt text, serve responsive sizes, and make images easier to find.

By the ScreenshotNeo team4 October 202611 min read

Good website image management is a repeatable workflow: preserve original assets, choose a format and compression level that suit each image, provide useful alternatives for assistive technology, deliver responsive sizes, and make important images discoverable in HTML. Keep only the variants that serve real page layouts, then review the result in context.

This guide covers the decisions and implementation details behind that workflow. For technical references, see MDN’s img element guidance, the W3C WAI image tutorial, web.dev’s image guidance, and Google Search Central’s image guidance.

1. Set an asset intake and source-file policy

Before optimizing files, decide how your team will receive, identify, approve, and replace them. A small site can use a shared folder and CMS conventions; a larger one may need a digital asset manager or an automated image pipeline. The important part is that people can identify the approved source and its intended use.

  • Keep the original. Store an untouched source file separately from delivery variants so you can make new crops or encodings later without degrading an already-compressed file.
  • Use predictable names. Prefer descriptive, stable names such as orchard-worker-harvest.jpg over IMG_4821-final2.jpg. Avoid renaming published assets casually if URLs are referenced elsewhere.
  • Record provenance. Track ownership, license, attribution requirements, and any usage limits with the asset or in your CMS metadata.
  • Assign responsibility. Make clear who approves a new image, who can replace one, and how a correction is propagated to cached or resized copies.
  • Capture context. Record the page or content topic, intended crop, focal point if relevant, and whether the image carries information or is decorative.

Do not create every imaginable dimension at intake. First map the image slots your design actually uses, such as article hero, card thumbnail, and inline image. A small set of useful derivatives is easier to store, invalidate, and keep consistent.

2. Decide the image’s purpose and write its alternative

Alt text is a text replacement for an image in its page context. Decide what the image does before writing it; the same asset can require different alternatives on different pages.

Image role What to put in the markup Example
Informative A concise equivalent of the information the image contributes. alt="Workers sorting apples at a packing line"
Decorative An empty alternative, alt="", so assistive technology can skip it. <img src="divider-leaves.svg" alt="">
Functional Describe the action or destination when the image is the link or button’s content. alt="View the orchard locations"
Complex chart or diagram Provide a short identification plus the detailed equivalent in nearby text or a linked data table. alt="Monthly rainfall by region; details follow"

Write the replacement, not a filename or a phrase such as “image of.” Read it alongside the preceding sentence: together they should communicate the intended point without needless repetition. If visible text already names the destination of a linked image, check that the accessible name remains clear and is not duplicated awkwardly.

For text-heavy charts, maps, and process diagrams, a brief alt string cannot carry every detail. Put the important relationships and values in adjacent text or a structured table. The W3C WAI image tutorial covers informative, decorative, functional, complex, and grouped images with examples.

3. Choose a format for the asset, then inspect the output

There is no one best format for every image. Select based on content, transparency, visual artifacts, compatibility requirements, and the tools in your publishing stack.

Format Often suitable for Watch for
WebP Photographs and many raster graphics where modern compression is useful. Check the result visually, especially around text, sharp edges, and flat color.
AVIF Raster images where its compression and feature set fit your delivery stack. Confirm that your CMS and supported clients handle the format as intended; keep a fallback when needed.
JPEG Photographs when broad historical compatibility is important. It is lossy and does not provide transparency.
PNG Lossless imagery, transparency, and graphics where compression artifacts are conspicuous. For photographic content, compare delivered size with other suitable formats.
SVG Scalable diagrams, icons, and interface graphics. Use it for vector-like artwork rather than as a general replacement for photographs.

For each representative asset type, compare a few export settings and inspect at the size people will see it. A lossy setting that looks acceptable on a photograph can damage small text, line art, or a logo. Do not optimize to a target percentage without looking at both the visual output and its byte size.

Tools such as Squoosh can help compare encodings. web.dev also discusses image optimization approaches, including services. These are examples, not a universal ranking: evaluate quality, delivered bytes, workflow fit, compatibility, automation, and cost for your own stack.

4. Serve responsive image candidates

A browser should receive candidates appropriate to the rendered slot, rather than one oversized file for every screen. With width descriptors, srcset lists candidate widths and sizes describes the expected CSS display width. The browser can use that information along with device characteristics to select a resource.

<img
  src="/images/orchard-800.jpg"
  srcset="/images/orchard-400.jpg 400w,
          /images/orchard-800.jpg 800w,
          /images/orchard-1200.jpg 1200w"
  sizes="(max-width: 700px) 100vw, 800px"
  width="1200"
  height="800"
  alt="Workers picking apples in an orchard">

The sizes value must reflect the actual layout. In this example, the image is expected to occupy the viewport width up to 700 CSS pixels and otherwise about 800 CSS pixels. Replace those assumptions with the slot widths your CSS produces. Width and height attributes communicate the image’s intrinsic ratio and help the browser reserve layout space before the file loads.

Generate candidates for real slots and breakpoints, not a large matrix of rarely used widths. The useful set depends on your design and traffic; there is no universal correct number. Recheck it when templates change.

Use picture for format fallback or art direction

Use <picture> when the browser should prefer one format and fall back to another, or when different crops are needed at different viewport sizes. Keep a normal img element with a fallback src.

<picture>
  <source
    type="image/avif"
    srcset="/images/orchard-800.avif 800w, /images/orchard-1200.avif 1200w"
    sizes="(max-width: 700px) 100vw, 800px">
  <source
    type="image/webp"
    srcset="/images/orchard-800.webp 800w, /images/orchard-1200.webp 1200w"
    sizes="(max-width: 700px) 100vw, 800px">
  <img
    src="/images/orchard-800.jpg"
    srcset="/images/orchard-400.jpg 400w, /images/orchard-800.jpg 800w"
    sizes="(max-width: 700px) 100vw, 800px"
    width="1200"
    height="800"
    alt="Workers picking apples in an orchard">
</picture>

For art direction, use <source media="..."> with a crop that suits that layout. Do not change the crop in a way that removes information necessary to understand the image. Verify your CMS produces valid markup and that the fallback image loads.

Use ordinary HTML image elements for content images that should be discoverable. Google says it can find image URLs in an img element’s src, including when that element is nested inside picture. CSS background images are not indexed as image content in the same way. Keep a fallback src in responsive markup because not every browser or crawler necessarily understands every responsive attribute.

  • Give the image a stable, crawlable URL that returns the intended image rather than an error or an HTML page.
  • Place it near relevant page text and use accurate alt text; avoid treating alt text as a place to repeat keywords.
  • Use an image sitemap when it can expose images that might otherwise be difficult for crawlers to discover, such as images reached through JavaScript-heavy paths.
  • Do not assume metadata guarantees a particular search preview. Google’s image preview choice is automated.

See Google Search Central’s guidance on Google Images for current discovery and markup details.

6. Build a publishing workflow that stays maintainable

  1. Intake: preserve the source, record its rights and intended role, and attach it to the right content record.
  2. Prepare: crop for the intended slot, export an appropriate format, and compare quality against file size.
  3. Generate variants: create the small set of responsive candidates required by actual templates.
  4. Add editorial metadata: write context-appropriate alt text or mark the image decorative with an empty alternative.
  5. Publish: use img with a fallback src, responsive candidates where useful, and intrinsic dimensions.
  6. Review: inspect on representative pages and viewport sizes, including the visual crop, layout behavior, and image loading.
  7. Replace carefully: update derivatives and cache entries when a source changes; preserve or redirect established URLs according to your site’s needs.

Every extra derivative adds storage, naming, cache, and invalidation work. Create a new one when it improves delivery for a real template or audience; remove obsolete variants when you can do so without breaking references.

7. Inspect the published page with a screenshot

Image files can look correct on their own but fail in context: a crop may hide the subject, a responsive breakpoint may choose a poor candidate, or a banner may cover the image. Capture representative pages at desktop and mobile sizes as part of visual review. A screenshot is useful for checking layout and crop; it does not replace keyboard, screen-reader, or markup checks for accessibility.

For a manual review, open the page in a browser at the viewport sizes your templates support, check the rendered image and surrounding layout, then inspect the image markup and alt text separately. Repeat after changing image delivery rules or CMS templates.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server from ScreenshotNeo. Send one GET request with the page URL to capture a PNG, JPEG, WebP, or PDF. See the API documentation for parameters and configuration.

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://example.com/article \
  -o review.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com/article"},
    timeout=90,
)
open("review.webp", "wb").write(r.content)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com/article'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('review.webp', res);
  • Cookie banners are accepted and 60+ known consent platforms, newsletter popups, and chat widgets are removed before capture; each cleanup step can be turned off.
  • Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing. Responses identify the page verdict and billing status in headers.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
  • The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan.

Sign up free for 1,000 screenshots a month, with no card required.

8. Troubleshooting image publishing problems

Symptom Likely cause Fix
Image looks blurry on a high-density display The selected candidate is too small for the rendered slot and device pixel ratio, or the source was enlarged. Check the chosen URL in browser developer tools; add a suitable candidate and verify sizes matches the rendered CSS width.
Browser downloads an unexpectedly large image The sizes hint is missing or inaccurate, or only a large candidate is available. Measure the slot at key breakpoints, correct sizes, and generate candidates for actual layouts.
Text or edges look damaged Lossy compression is too strong for fine detail or flat-color artwork. Use a higher quality setting, lossless encoding, or a more appropriate format, then compare the result visually.
Image has no transparency or an unwanted background The selected format or export settings do not preserve alpha transparency. Choose a format and encoder settings that preserve transparency, and verify the output against the intended page background.
Image appears stretched or causes layout shift Intrinsic dimensions are absent or conflict with the source aspect ratio, or CSS forces incompatible dimensions. Set accurate width and height attributes and review responsive CSS and crop rules.
Fallback never appears A source or URL is malformed, the preferred format is served with the wrong MIME type, or the fallback is missing. Inspect network responses and markup; ensure each source URL works and retain a valid img src.
Search crawler misses an image The image is only a CSS background, inaccessible to the crawler, or absent from discoverable markup. Use an HTML img with a working src; consider an image sitemap for otherwise hard-to-find assets.
Updated image does not show after replacement A browser, CDN, or application cache still serves the old URL content. Use your stack’s cache invalidation or versioned asset URL strategy, then verify the returned response.
Alt text repeats nearby copy or is unhelpful It describes appearance without explaining the image’s role, or duplicates adjacent text. Revisit whether the image is informative, decorative, functional, or complex; write the appropriate equivalent in context.

9. Performance, reliability, and cost considerations

Performance

Serve no more pixels or bytes than the displayed slot needs, but preserve enough detail for the intended viewing conditions. Responsive candidates, sensible compression, and format choice work together; none compensates for an incorrect crop or a slot that downloads a much larger source than necessary. Measure real pages and inspect network requests across representative viewport sizes.

Reliability

Keep original assets, make derivative generation repeatable, and retain a valid fallback source. Treat URL stability, cache invalidation, and CMS transformations as part of image correctness. Validate generated markup after template or pipeline changes, since a technically valid source file can still be published with a broken URL, missing dimensions, or poor alternative text.

Cost and operational overhead

Costs depend on your own hosting, storage, CMS, and image-processing setup; this research does not establish current vendor prices or a universally best service. Compare the ongoing cost of storage, transformations, automation, and maintenance with the bytes and editorial effort saved. Avoid generating variants without a clear delivery benefit because they increase storage and cache complexity.

10. Website image management checklist

  • Original is preserved and ownership or license details are recorded.
  • Filename and CMS record identify the asset clearly.
  • Format and compression suit the image content and have been visually checked.
  • Image role is identified and alt text is meaningful, empty for decorative content, or supported by a detailed equivalent when needed.
  • Responsive candidates map to real layout slots, and sizes reflects the rendered width.
  • Intrinsic dimensions are accurate; crops remain useful at target breakpoints.
  • An HTML img and fallback src are present for content images that should be discovered.
  • Published pages have been reviewed for appearance, delivery, and accessibility in context.
  • Replacement and cache invalidation procedures are understood.

Frequently asked questions

Should I convert every existing image to WebP or AVIF?

No. Convert when the format fits the content and your publishing stack, and compare quality and delivered size. Retain a fallback if your supported clients or tools require one.

How many responsive image sizes should I generate?

Generate enough candidates for the actual slots and breakpoints in your design. There is no universal count; avoid a large set of rarely selected files.

Can I leave alt text out for a decorative image?

Use an empty alt="" attribute. This signals that the image adds no information that needs to be announced.

No. A sitemap can help expose images that are otherwise difficult to discover, but it does not guarantee indexing or a particular search preview.