Token导航 LogoToken导航TokenDH.com
图像处理操作浏览器github未标认证来源可访问许可证需确认审计通过

image-optimization图像优化

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

12,607

周安装

536

GitHub Stars

409

下载量

4,417
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:image-optimization(图像优化)
来源仓库:https://github.com/kostja94/marketing-skills
仓库路径:skills/image-optimization
安装命令:
npx skills add https://github.com/kostja94/marketing-skills --skill image-optimization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kostja94/marketing-skills --skill image-optimization

简介

image-optimization 用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。

  • 适用于文本生成图片、背景处理和视觉提示词整理等图像处理需求。
  • 使用时需确认输入图片、版权来源、输出格式和模型限制条件。
  • 涉及人物、品牌或公开展示素材时应额外核对授权与合规边界。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

SEO On-Page: Image Optimization

Guides image optimization for Google Search (text results, Image Pack, Google Images, Discover), Core Web Vitals (LCP), and accessibility. Consolidates image-related best practices from components (hero, trust-badges) and pages (landing-page). References: Google Image SEO, Semrush Image SEO.

When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.

Scope

  • Discovery & indexing: HTML img elements, image sitemap
  • Format & performance: WebP, responsive images, lazy loading, LCP; full CWV optimization in core-web-vitals
  • Metadata: Alt text, file names, captions
  • Preferred image: primaryImageOfPage, og:image; thumbnail next to title/description in search results
  • Structured data: ImageObject, image in Article/Product/etc.

Initial Assessment

Check for project context first: If .claude/project-context.md or .cursor/project-context.md exists, read it for brand and page context.

Identify:

  1. Context: Hero, content page, product, trust badge, social preview
  2. Above vs below fold: LCP candidate (hero) vs lazy-loadable
  3. Image count: Single hero vs gallery, programmatic pages

1. Discovery & Indexing

Use HTML Image Elements

Google finds images in the src attribute of <img> (including inside <picture>). CSS background images are not indexed.

DoDon't
<img src="puppy.jpg" alt="Golden retriever puppy" /><div style="background-image:url(puppy.jpg)">

Image Sitemap

Submit an image sitemap to help Google discover images it might otherwise miss. Image sitemaps can include URLs from CDNs (other domains); verify CDN domain in Search Console for crawl error reporting.

Structure (from Google):

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://example.com/page</loc>
    <image:image>
      <image:loc>https://example.com/image.jpg</image:loc>
    </image:image>
  </url>
</urlset>

See xml-sitemap for sitemap index and submission. Image sitemap is an extension; can be standalone or combined with page sitemap.


2. Format & Performance

Supported Formats

Google supports: BMP, GIF, JPEG, PNG, WebP, SVG, AVIF. Match filename extension to format.

FormatBest forNotes
WebPPhotos, graphicsSmaller files, faster load; lossy + lossless; transparency, animation
AVIFModern browsersEven smaller than WebP; check support
JPEGStandard photosFallback; widely supported
PNGTransparency, detailLarger; use when needed
SVGIcons, logosScalable; use <title> for inline SVG alt
GIFSimple animationFirst frame only for preview

Responsive Images

Use <picture> or srcset for different screen sizes. Always provide fallback src—some crawlers don't understand srcset.

<img
  srcset="image-320w.jpg 320w, image-480w.jpg 480w, image-800w.jpg 800w"
  sizes="(max-width: 320px) 280px, (max-width: 480px) 440px, 800px"
  src="image-800w.jpg"
  alt="Descriptive alt text">

Picture element (format fallback, e.g. WebP → PNG):

<picture>
  <source type="image/webp" srcset="image.webp">
  <img src="image.png" alt="Descriptive alt text">
</picture>

Data URI (Inline Images)

Base64 data URIs (data:image/...;base64,...) reduce HTTP requests but increase HTML size. Use sparingly for small icons; avoid for large images. See web.dev.

Resize & Compress

  • Max width: Generally ≤2,500px; match container max-width
  • Compression: WebP preferred; quality 75–85 for lossy; 72dpi for web
  • LCP: Hero/above-fold images are LCP candidates; optimize aggressively

Lazy Loading

Use loading="lazy" only for below-fold images. Above-fold images (hero) must load immediately—lazy loading them hurts LCP.

<img src="hero.jpg" alt="..." loading="eager">
<img src="below-fold.jpg" alt="..." loading="lazy">

3. Alt Text

Alt text improves accessibility (screen readers, low bandwidth) and SEO (Google uses it with computer vision to understand images). It also serves as anchor text if the image is a link.

Best Practices

DoDon't
Useful, information-rich descriptionKeyword stuffing
Context of page content"image of" or "photo of" (redundant)
Max ~125 characters (some assistive tech truncates)Empty alt on meaningful images
Descriptive for functional imagesAlt on purely decorative images (use alt="")

Examples (from Google):

  • ❌ Missing: <img src="puppy.jpg"/>
  • ❌ Stuffing: alt="puppy dog baby dog pup pups puppies..."
  • ✅ Better: alt="puppy"
  • ✅ Best: alt="Dalmatian puppy playing fetch"

Captions

Google extracts image context from captions and nearby text. Use <figcaption> or descriptive text near the image.

UsePurpose
Topic relevanceCaption describes image subject; supports indexing
Featured SnippetsImages near answers with captions can capture thumbnail slots; see featured-snippet
Image PackAlt + caption + file name help Image Pack display; see serp-features

Inline SVG

Use <title> inside SVG for accessibility:

<svg aria-labelledby="svgtitle1">
  <title id="svgtitle1">Descriptive text for the SVG</title>
</svg>

4. File Names

Descriptive filenames give Google light clues about subject matter.

DoDon't
apple-iphone-15-pink-side-view.jpgIMG00353.jpg
Short, hyphen-separatedGeneric: image1.jpg, pic.gif
Localize filenames for translated pagesOverly long filenames

5. Preferred Image (SERP Thumbnail & Discover)

When users search for keywords, optimized images can appear as thumbnails next to the page title and description in search results—enhancing visibility and CTR. Google also uses these images for Google Discover. Search Engine Land

Google selects thumbnails automatically from multiple sources. Influence selection via:

Schema: primaryImageOfPage

{
  "@context": "https://schema.org",
  "@type": "WebPage",
  "url": "https://example.com/page",
  "primaryImageOfPage": "https://example.com/images/cat.png"
}

Or attach image to main entity (e.g. BlogPosting, Article) via mainEntity or mainEntityOfPage.

Open Graph

<meta property="og:image" content="https://example.com/images/cat.png">

Preferred image rules: Relevant, representative; avoid generic (e.g. logo) or text-heavy images; avoid extreme aspect ratios; high resolution. See open-graph, twitter-cards for social specs.

Google Discover (if targeting Discover): ≥1200px wide; ≥300KB; 16:9 aspect ratio preferred; important content visible in landscape crop.


6. Page Context

  • Title & meta description: Google uses page title and meta for image result snippets. See title-tag, meta-description.
  • Placement: Put images near relevant text; page subject matter influences image indexing.
  • Same URL: Reference the same image with the same URL across pages for cache efficiency and crawl budget.

7. Structured Data

Add structured data for rich results in Google Images (badges, extra info). Image attribute is required for eligibility. See schema-markup for ImageObject, Article, Product, Recipe, etc.


8. Specs by Context

ContextPriorityNotes
HeroLCP, alt, no lazySee hero-generator; above-fold, fast load
Article / Blog hero1200–1600px wide; proportional height; 1200×630 for og:imageSame image for Schema, Open Graph, Twitter Cards; under 200 KB; WebP preferred; descriptive alt; set width/height to prevent CLS; use srcset/sizes for responsive; articles with relevant images get ~94% more views
Trust badgesAlt textSee trust-badges-generator; e.g. "Norton Secured"
Landing pageAll aboveSee landing-page-generator Pre-Delivery Checklist
OG / Twitter1200×630, 1200×675See open-graph, twitter-cards
PlatformsPer-platformX, LinkedIn, Pinterest—see platform skills

9. Opt-Out & SafeSearch

  • Inline linking opt-out: Prevent full-sized image display in Google Images via HTTP referrer check (200 or 204). See Google docs.
  • SafeSearch: Label pages for explicit content if applicable.

Output Format

  • Alt text suggestions per image
  • Captions (if applicable; snippet/Image Pack context)
  • File name recommendations
  • Format (WebP, fallback)
  • Responsive (srcset/sizes or picture)
  • Lazy loading (above-fold vs below-fold)
  • Image sitemap (if many images)
  • Preferred image (schema, og:image) for key pages

Related Skills

  • core-web-vitals: LCP, INP, CLS; image optimization supports LCP
  • xml-sitemap: Sitemap structure; image sitemap extension
  • open-graph, twitter-cards: og:image, twitter:image; social preview
  • schema-markup: ImageObject, Article/Product image
  • content-optimization: Multimedia in content; defers image SEO to this skill
  • featured-snippet: Images near answers + captions; snippet thumbnail
  • serp-features: Image Pack; alt, captions, file names
  • visual-content: Visual content for social, infographics; website images use this skill

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.29%
按下载量换算1,691

Claude

28.23%
按下载量换算1,247

Cursor

20.91%
按下载量换算924

Gemini CLI

10%
按下载量换算442

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills