Index of every page on this site: llms.txt
All skills
wghust avatar

/create-favicon

@e591e3f
by wghustwghust/stark-skills5 stars
Run it yourself

Generate a standards-aligned browser favicon.ico from a user-supplied source image, embedding PNG rasters at 32×32, 48×48, and 180×180 in one ICO container. Use when the user asks to create a favicon, 生成 favicon、网站图标、从图片做 ico、favicon.ico、create favicon from image. 从用户提供的源图生成含 32/48/180 三档尺寸的 favicon.ico(ICO 内嵌 PNG)。若用户未上传或未指定可用源图,必须中止并提示上传/路径。

Use this Skill: https://skilld.dev/gh/wghust/stark-skills/create-favicon

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesico-format-and-browser-notes.md

≈771 tokens on demand. Your agent reads this file only when SKILL.md points to it.

ICO 格式与浏览器要点(create-favicon)

ICO 是什么

favicon.ico 使用的 ICO 是 容器格式(Windows icon),不是单张裸 PNG 改扩展名。一个文件可包含多幅不同尺寸的图像;浏览器会按场景选用合适条目。

权威概述可参考:

文件布局(概念)

  1. ICONDIR(6 字节)

    • Reserved = 0
    • Type = 1(图标,非光标)
    • Count = 嵌入图像数量(本 skill 产出为 3)
  2. Count 条 ICONDIRENTRY(每条 16 字节)
    记录宽、高、色深相关字段、图像数据字节数、在文件中的 偏移。

  3. 图像数据区
    每条数据为 完整 PNG(推荐,带 PNG 文件头)或传统 BMP DIB(不含 BITMAPFILEHEADER)。
    自 Windows Vista 起 ICO 内嵌 PNG 被广泛支持;本仓库 CLI 三档均使用嵌入 PNG(RGBA),利于透明与体积。

宽/高字段为 1–255;若为 256 则宽或高字段写 0(本 skill 的 32、48、180 均直接写数值)。

MIME 类型

  • IANA:image/vnd.microsoft.icon
  • 历史上常见:image/x-icon
    部署时以服务器配置为准;两者在实践中都可遇到。

方形画布与非方形源图(contain / cover)

Favicon 的每一档都是 正方形像素。源图若不是 1:1,必须把图放进方框里:

  • 默认 contain:整张图缩小后 完整可见,两侧或上下 留白;有 alpha 时常为 透明 边,无 alpha(如 JPEG)时 CLI 使用 白边(见 USAGE.md)。这样图标在观感上仍是用户提供的同一枚图形,而非被裁成另一构图。
  • cover(仅用户明确要求):铺满方形,裁掉超出部分,可能改变可见内容。

本 skill 的三档尺寸

边长 常见用途(简述)
32×32 标签栏、部分桌面/列表图标
48×48 部分系统 UI、较大列表
180×180 常与 Apple Touch Icon 同尺寸;此处按需求 嵌入 ICO,便于单文件多分辨率

三档为 同一构图 的不同像素密度;CLI 使用 Lanczos 高质量缩放。详见 USAGE.md。

Apple Touch Icon 与 favicon.ico 的关系

  • 许多站点会额外提供 /apple-touch-icon.png(180×180) 供 iOS 主屏幕等场景。
  • 将 180×180 放进 favicon.ico 在格式上合法,但 不应 假设 iOS 会优先或唯一使用该 ICO 内大图;需要精致主屏幕图标时,仍建议按平台文档提供独立 PNG 与 <link rel="apple-touch-icon" …>。

粗校验思路

  • 文件头:00 00 01 00,随后 03 00 表示 3 张图(小端)。
  • 按目录项偏移找到三段子图,每段应以 PNG 魔数 89 50 4E 47 0D 0A 1A 0A 开头。
  • 解码 PNG 后确认像素尺寸分别为 32、48、180(实现细节见工具 README)。

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts6mo3 checks · Risk SAFE
  • Gen Agent Trust Hub6mo

    The skill provides instructions for an AI agent to generate a standards-aligned favicon.ico file using a bundled Node.js tool. It includes a mandatory check to ensure a source image is provided before execution and uses standard development workflows for setup. No malicious patterns or security risks were detected.

  • Socket6mo

    No alerts

  • Snyk6mo

    Risk: LOW · No issues

Signed by skilld at e591e3f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Dormantupdated 8 months ago

README badge

README badge for wghust/stark-skills/create-favicon