Логотип Wikimedia Commons Svg

Wikimedia Commons Svg

Сообщество
fuzheado
wikimedia-commons-svg

Work with SVG files on Wikimedia Commons — viewing and retrieving raw SVG source vs PNG preview, W3C validation badges, creation tools (Inkscape, Illustrator), optimization (scour, SVGO), versioning and diffing SVG revisions, SVG-specific templates and categories, structured data for vector files, and animated SVG considerations

Обзор

Издательfuzheado
РепозиторийWikipedia-AI-Skills
Название навыкаwikimedia-commons-svg
Звёзды
27
Форки
10
Файлы в комплекте
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — fuzheado. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Wikimedia Commons Svg в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-commons-svg
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fuzheado/Wikipedia-AI-Skills.git /tmp/Wikipedia-AI-Skills
mkdir -p .claude/skills
cp -r /tmp/Wikipedia-AI-Skills/.claude/skills/wikimedia-commons-svg .claude/skills/wikimedia-commons-svg
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Wikimedia Commons Svg в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Wikimedia Commons Svg, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Wikimedia Commons Svg не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

⚠️ User-Agent required: All curl and code examples in this skill access Wikimedia APIs. Requests without a descriptive User-Agent header will be blocked with HTTP 403 or 429. See the wikimedia-api-access skill for the correct format and rate-limiting patterns.


1. SVG on Commons: What's Different

SVG files on Commons behave differently from raster images in several important ways:

No native raster resolution. The width and height reported by the API are the SVG's viewBox dimensions, not a pixel grid. An SVG might report width: 103, height: 94 (like the Wikipedia logo) but can be rendered cleanly at any size.

Commons rasterizes SVGs to PNG. When a thumbnail is requested, Commons converts the SVG source to a PNG bitmap. This means:

  • The raw SVG source and the displayed preview are different files
  • The thumbmime is image/png, not image/svg+xml
  • Any requested width is valid — there's no native resolution cap

The file page shows a PNG preview. When you visit File:Wikipedia-logo-v2.svg on Commons, what you see in the browser is a rasterized PNG render, not the SVG itself rendered by your browser. Clicking "Download" gives you the raw SVG.

🔗 Thumbnail mechanics: See wikimedia-commons-thumbnails (Section 4: Format Conversion Matrix) for how SVG→PNG rasterization works via iiurlwidth and the thumbmime field.


2. Viewing and Retrieving SVG Source

Via the File Page

  1. Navigate to File:Foo.svg on Commons
  2. The page displays a PNG preview of the SVG
  3. Below the preview, the "File information" section shows metadata (description, date, source, author, license)
  4. The download link provides the raw .svg file

Via the Action API — Raw Source URL

The API's prop=imageinfo with iiprop=url returns the raw SVG URL:

python
import requests
resp = requests.get("https://commons.wikimedia.org/w/api.php", params={
    "action": "query",
    "prop": "imageinfo",
    "iiprop": "url|mime",
    "titles": "File:Wikipedia-logo-v2.svg",
    "format": "json",
}, timeout=30, headers={"User-Agent": "MyBot/1.0 (user@example.com)"})

info = resp.json()["query"]["pages"]["10337301"]["imageinfo"][0]
raw_svg_url = info["url"]  # → "https://upload.wikimedia.org/wikipedia/commons/8/80/Wikipedia-logo-v2.svg"
print(f"MIME: {info['mime']}")  # → "image/svg+xml"

Via action=raw (Wikitext Source)

You can also retrieve the wikitext description page of the file (which contains the {{Information}} template and categories) using action=raw:

https://commons.wikimedia.org/w/index.php?title=File:Foo.svg&action=raw

⚠️ This returns the file description wikitext, NOT the SVG source. To get the SVG source, use the URL from prop=imageinfo → url (as above).

Distinguishing the SVG from Its Preview

URLReturnsUse Case
upload.wikimedia.org/.../Foo.svgRaw SVG XMLProcessing, editing, analysis
.../thumb/.../Foo.svg/800px-Foo.svg.pngRaster PNGDisplay, embedding
commons.wikimedia.org/wiki/File:Foo.svgHTML file pageBrowsing metadata
commons.wikimedia.org/w/index.php?title=File:Foo.svg&action=rawWikitext descriptionReading categories, templates

3. SVG Validation on Commons

Commons runs submitted SVGs through the W3C Markup Validation Service to check for well-formed XML and valid SVG elements.

Validation Badges

Valid SVGs display a badge on the file page:

BadgeTemplateMeaning
✅ Valid SVG{{ValidSVG}}Passed W3C validation
❌ Invalid SVG{{InvalidSVG}}Failed validation
— (no badge)—Not yet validated

Checking Validation via the API

The validation status is not directly exposed as an API field. It's inferred from categories:

python
resp = requests.get("https://commons.wikimedia.org/w/api.php", params={
    "action": "query",
    "prop": "categories",
    "titles": "File:Wikipedia-logo-v2.svg",
    "format": "json",
}, timeout=30, headers={"User-Agent": "MyBot/1.0 (user@example.com)"})

pages = resp.json()["query"]["pages"]
categories = [cat["title"] for cat in next(iter(pages.values())).get("categories", [])]

is_valid = any("Valid SVG" in cat for cat in categories)
is_invalid = any("Invalid SVG" in cat for cat in categories)
print(f"Valid: {is_valid}, Invalid: {is_invalid}")

Common validation categories:

  • Category:Valid SVG — the SVG passes W3C validation
  • Category:Valid SVG created with Inkscape — validated + creator tool known
  • Category:Valid SVG created with Adobe Illustrator
  • Category:SVG with errors — has issues that may affect rendering

Common SVG Validation Errors

ErrorCauseFix
Unclosed tagsMissing </path>, </g>, etc.Check XML well-formedness
Incorrect namespaceMissing xmlns="http://www.w3.org/2000/svg"Add the SVG namespace
Invalid CSSCSS within <style> that doesn't parseValidate CSS separately
Non-standard elementsBrowser-specific elements or proprietary Inkscape/Illustrator extensionsUse standard SVG elements only, or strip with --export-plain-svg
Embedded raster images<image href="data:image/png..."> inside SVGCommons allows this but the embedded image may violate licensing

4. SVG Creation and Editing Tools

Common Creation Tools

ToolTemplateNotes
Inkscape{{Created with Inkscape}}Free, open-source. Most popular for Commons. Use File → Save As → Plain SVG to remove Inkscape-specific XML
Adobe Illustrator{{Created with Adobe Illustrator}}Proprietary. Export as plain SVG. May add illustrator-specific XML
Text Editor{{Created with Text Editor}}For hand-coded SVGs. Minimal, clean SVG
SVG-edit{{Created with SVG-edit}}Browser-based, lightweight
Draw.io / diagrams.net{{Created with draw.io}}For diagrams and flowcharts

💡 Always use "Plain SVG" or equivalent. Inkscape adds Inkscape-specific namespace declarations and metadata (inkscape:version, sodipodi:namedview) that are unnecessary on Commons. Use File → Save As → Plain SVG (inkscape --export-plain-svg) to strip them.

Converting from Other Formats

SourceMethod
PDF → SVGinkscape input.pdf --export-plain-svg=output.svg
EPS → SVGinkscape input.eps --export-plain-svg=output.svg
AI → SVGOpen in Illustrator → "Save As" → SVG
Image trace → SVGInkscape: Path → Trace Bitmap, or potrace CLI

Font Licensing: The Text-to-Path Decision

This is a recurring debate among SVG contributors:

ApproachProsCons
Embedded text (<text>)Editable, smaller file, searchableFont must be freely licensed; may render differently on different systems
Text-to-path (<path>)Renders identically everywhere; no font dependencyNot editable as text; larger file; not searchable

Commons policy: If using embedded fonts, the font must itself be freely licensed (compatible with CC BY-SA). When in doubt, convert text to paths. Always keep an editable copy locally.

bash
# Convert text to paths in Inkscape (CLI)
inkscape input.svg --export-text-to-path --export-plain-svg=output.svg

5. SVG Optimization

SVG files can balloon in size from verbose paths, high decimal precision, unused defs, and editor metadata. Optimization is encouraged on Commons.

Tools

ToolPurposeExample
scourPython-based SVG cleanerscour -i input.svg -o output.svg --enable-viewboxing
SVGONode.js-based optimizernpx svgo input.svg -o output.svg
InkscapeRemove editor metadatainkscape --export-plain-svg --export-filename=output.svg input.svg

What Optimization Does

  • Reduces decimal precision: M0.000000,5.000000 → M0,5
  • Removes unused <defs>, gradients, masks
  • Removes editor metadata (inkscape:, sodipodi:, illustrator: namespaces)
  • Merges overlapping paths
  • Collapses redundant groups
  • Compresses path data

Optimization Templates on Commons

Editors can mark optimization status on the file page:

TemplateMeaning
`{{SVGoptimized}}`
`{{SVGcleaned}}`
`{{SVGunoptimized}}`
bash
# Full optimization pipeline
scour -i raw.svg -o cleaned.svg --enable-viewboxing --strip-xml-prologue \
  --remove-titles --remove-descriptions --remove-metadata \
  --disable-escape-non-ascii --enable-id-stripping

# SVGO alternative
npx svgo --multipass raw.svg -o cleaned.svg

6. Versioning and Updating SVGs

Uploading a New Version

Upload a new version of an existing SVG using the Action API:

python
import requests

SESSION = requests.Session()
SESSION.auth = ("User@botname", "bot_password")
SESSION.headers.update({"User-Agent": "MyBot/1.0 (user@example.com)"})

# Step 1: Get CSRF token
token_resp = SESSION.get("https://commons.wikimedia.org/w/api.php", params={
    "action": "query", "meta": "tokens", "type": "csrf", "format": "json",
})
csrf_token = token_resp.json()["query"]["tokens"]["csrftoken"]

# Step 2: Upload the new SVG version
with open("improved-version.svg", "rb") as f:
    resp = SESSION.post("https://commons.wikimedia.org/w/api.php", data={
        "action": "upload",
        "filename": "Existing_File.svg",  # must match existing filename
        "comment": "Fixed overlapping paths, optimized with SVGO",
        "token": csrf_token,
        "format": "json",
    }, files={"file": f})

print(resp.json())

⚠️ Authentication required. See wikimedia-auth-oauth for bot password setup.

File History

All previous versions of an SVG are retained in the file history. You can access them via the "File history" section on the file page or via the API:

python
resp = SESSION.get("https://commons.wikimedia.org/w/api.php", params={
    "action": "query",
    "prop": "imageinfo",
    "iiprop": "url|timestamp|user|comment|size",
    "titles": "File:Foo.svg",
    "iiend": "2024-01-01T00:00:00Z",   # optional: end date
    "format": "json",
})

Diffing SVG Versions

Since SVG is XML (text), you can diff versions using standard text comparison:

python
import difflib

# Fetch two versions' raw SVG source
v1_url = "https://upload.wikimedia.org/wikipedia/commons/archive/8/80/20220101120000%21Foo.svg"
v2_url = "https://upload.wikimedia.org/wikipedia/commons/8/80/Foo.svg"

v1 = requests.get(v1_url, timeout=30, headers={"User-Agent": "MyBot/1.0"}).text
v2 = requests.get(v2_url, timeout=30, headers={"User-Agent": "MyBot/1.0"}).text

diff = difflib.unified_diff(v1.splitlines(), v2.splitlines(), lineterm="")
print("\n".join(diff))

⚠️ Archive URL pattern: Previous versions are stored at https://upload.wikimedia.org/wikipedia/commons/archive/{hash_path}/{timestamp}!{filename}. The timestamp format is YYYYMMDDHHMMSS.

⚠️ Cache Implications of Updating SVGs

When you update an SVG:

  1. All existing thumbnail URLs remain the same URL path
  2. The old thumbnails are purged from Varnish cache
  3. New thumbnails are generated on first request (cold cache — may be slow for the first few requests)
  4. Wikipedia articles using this SVG will reflect the updated version once their page cache refreshes

7. SVG-Specific Metadata and Categories

Information Template for SVGs

The {{Information}} template on SVG file pages has the same fields as for raster files, but some are especially relevant:

FieldSVG Relevance
DescriptionWhat the SVG depicts, including its intended use (flag, map, logo, diagram)
DateDate of creation, not date of upload
SourceHow the SVG was created (traced from raster? generated from data? hand-coded?)
AuthorCreator name (may differ from uploader)
Other versionsLinks to related SVG files (e.g., localized versions, color variants)

SVG-Specific Templates

TemplatePurpose
{{SVG}}Marks the file as an SVG; adds it to Category:SVG files
{{ValidSVG}}Indicates the SVG passed W3C validation
{{InvalidSVG}}Indicates the SVG failed validation
{{Created with Inkscape}}+ Category:Valid SVG created with Inkscape
{{Created with Adobe Illustrator}}+ Category:Valid SVG created with Adobe Illustrator
{{Path text SVG}}The SVG uses paths for text (text-to-path)
{{Uses SVG}}Places the SVG in Category:Uses SVG (for non-SVG pages that describe/reference SVG files)

Category Hierarchy for SVGs

The SVG category tree on Commons is extensive:

Category:SVG files
├── SVG files by topic
│   ├── SVG flags
│   ├── SVG maps
│   ├── SVG logos
│   ├── SVG coats of arms
│   └── SVG diagrams
├── SVG files by creation tool
│   ├── Valid SVG created with Inkscape
│   ├── Valid SVG created with Adobe Illustrator
│   └── ...
├── SVG files by validity
│   ├── Valid SVG
│   └── SVG with errors
├── SVG files by language
│   ├── SVG files in English
│   └── ...
├── SVG files with embedded text
├── SVG files converted to path
└── SVG files by size
    ├── Large SVG files
    └── Tiny SVG files

The "High-resolution or SVG" Category

Commons uses the Category:High-resolution or SVG as a meta-category. Files here are either:

  • Raster images above a certain pixel threshold, or
  • SVG files (which are inherently resolution-independent)

This is relevant for search — you can find "high quality" files by including this category.


8. SVG and Structured Data (SDC)

SVG files use the same SDC system as raster files (see wikimedia-commons-sdc), but some property usage patterns differ.

Depicts (P180) for SVGs

SVGs often depict abstract, structured, or typographic subjects:

TypeCommon P180 Values
FlagQ14660 (flag), specific country/city flag Q item
MapQ40087 (map), geographic region Q item
LogoQ179903 (logo), organization Q item
DiagramAppropriate topic Q item
EmblemQ1642034 (coat of arms), specific entity Q item
SymbolAppropriate concept Q item

Digital Representation of (P6243)

For SVGs that are direct digital surrogates of a specific work or item:

python
# In the SDC editor (via wbcreateclaim):
# entity=M12345, property=P6243, value={"id":"Q179900"}

This is especially common for:

  • Vectorized versions of famous logos
  • SVG recreations of historical maps
  • Digital versions of flags based on official specifications

Instance of (P31) for SVG Types

P31 ValueSVG TypeExample
Q207694FlagFile:Flag_of_France.svg
Q40087MapFile:World_map.svg
Q179903LogoFile:Wikipedia-logo-v2.svg
Q1642034Coat of armsFile:Coat_of_arms_of_Germany.svg
Q8274129Vector imageGeneric SVG (fallback)

9. Animations and Special Formats

Animated SVG on Commons

SVG supports animation via:

  • CSS animations (@keyframes, animation-*)
  • SMIL (Synchronized Multimedia Integration Language — <animate>, <animateTransform>, <set>)

Commons does support animated SVGs — they are not stripped on upload. However:

  • Animated SVGs are still rasterized to a static PNG for the file page preview
  • The animation plays only when the raw SVG is opened directly (in a compatible browser)
  • Wikipedia articles typically display the static PNG preview, not the animation
  • For animated content on articles, GIF or APNG are usually preferred because they work in all browsers automatically

SVG vs APNG vs GIF

FormatAnimationQualityFile SizeBrowser Support
Animated SVGNative vector animationPerfect at any scaleSmallGood, but disabled in Wikipedia article rendering
APNGFrame-basedLosslessMediumWide (replacing GIF)
GIFFrame-based256 colorsMedium-LargeUniversal

When to use each:

  • Animated SVG: For vector animations that benefit from scaling (spinners, icons, loading animations). Works best as a standalone file.
  • APNG: For complex frame animations with millions of colors (screenshots, UI demos). Preferred over GIF on Commons.
  • GIF: For simple frame animations with flat colors or when backward compatibility is essential.

⚠️ JavaScript in SVGs

SVGs may contain <script> elements, but Commons strips JavaScript from uploaded SVG files. If you upload an SVG with embedded JS, it will be removed by the upload pipeline. This is a security measure to prevent XSS in the wiki context.

If you need interactivity, consider:

  • Using CSS animations (which are allowed) for visual effects
  • Creating a separate interactive tool on Toolforge and linking to it from the file description

Related Skills

SkillRelevance
wikimedia-api-accessUser-Agent, rate limiting, error handling
wikimedia-commonsFile search, categories, upload basics
wikimedia-commons-thumbnailsSVG→PNG rasterization, thumb URL scheme, thumbmime
wikimedia-commons-sdcStructured data for SVG depicts, copyright, license
wikimedia-commons-sparqlQuery SVGs by file type, depicts, or dimensions via SPARQL
wikimedia-auth-oauthAuthentication for uploading new SVG versions

Часто задаваемые вопросы

Что делает навык ИИ Wikimedia Commons Svg?

Work with SVG files on Wikimedia Commons — viewing and retrieving raw SVG source vs PNG preview, W3C validation badges, creation tools (Inkscape, Illustrator), optimization (scour, SVGO), versioning and diffing SVG revisions, SVG-specific templates and categories, structured data for vector files, and animated SVG considerations

Зачем использовать Wikimedia Commons Svg в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Wikimedia Commons Svg — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Wikimedia Commons Svg в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/fuzheado/Wikipedia-AI-Skills/tree/main/.claude/skills/wikimedia-commons-svg. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Wikimedia Commons Svg?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Wikimedia Commons Svg?

С любым количеством. В TypingMind вы можете использовать Wikimedia Commons Svg с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Wikimedia Commons Svg?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — fuzheado. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип openclaw

Clawsweeper

openclaw
ОрганизацияПопулярный

Для любых задач ClawSweeper: отчёты о проверке issue/PR в OpenClaw, задания на исправление, PR с облачными исправлениями, команды упоминания сопровождающих @clawsweeper, доверенные автоисправления и автомерж после проверки ClawSweeper, мониторинг GitHub Actions…

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Control Ui E2e

openclaw
ОрганизацияПопулярный

Используйте при проектировании, тестировании, исправлении или расширении графического интерфейса OpenClaw Control UI, включая галереи стресс-тестов интерфейса с полями для отзывов, сквозные проверки Vitest + Playwright, сценарии Gateway с заглушками…

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Deslop

openclaw
ОрганизацияПопулярный

Очистка AI-slop только в изменениях ветки: удалите лишние комментарии и защитные проверки, маскировку типов и отклонения от стиля перед автоматическим ревью.

82.2K
391K
Инструкции
Открыть
Логотип openclaw

Discord Clawd

openclaw
ОрганизацияПопулярный

Используйте для общения с агентом или сессией OpenClaw, связанными с Discord; не используйте для поиска по архиву.

82.2K
391K
Файлы: 1
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇