huashu-image-upload

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

图片配图与上传

Image Illustration and Upload

为公众号文章自动生成配图、上传到图床、插入Markdown链接的专业能力。
Professional capability for automatically generating illustrations for official account articles, uploading to image hosting, and inserting Markdown links.

何时使用此Skill

When to Use This Skill

当检测到以下场景时,自动加载此skill:
  • 用户说"现在配图"、"帮我配图"、"添加图片"
  • 文章审校完成后提到配图需求
  • 检测到文章内容完整但缺少图片
Automatically load this skill when detecting the following scenarios:
  • User says "generate illustration now", "help me create illustrations", "add images"
  • Illustration needs are mentioned after article review is completed
  • Article content is complete but lacks images

核心功能

Core Features

  1. 分析配图需求:根据文章内容确定需要5-8张配图
  2. 获取图片源
    • 公共领域作品(Wikimedia Commons、Google Arts & Culture)
    • AI生成图片(火山引擎 doubao-seedream API)
    • 免费图库(Unsplash、Pexels)
  3. 自动上传图床:调用ImgBB图床,获取永久链接
  4. 插入Markdown:将图片链接插入文章对应位置
  5. 验证显示:确保所有图片链接有效
  1. Analyze Illustration Requirements: Determine 5-8 illustrations needed based on article content
  2. Obtain Image Sources:
    • Public domain works (Wikimedia Commons, Google Arts & Culture)
    • AI-generated images (Volcano Engine doubao-seedream API)
    • Free image libraries (Unsplash, Pexels)
  3. Auto-upload to Image Hosting: Call ImgBB image hosting to get permanent links
  4. Insert into Markdown: Insert image links at corresponding positions in the article
  5. Validation & Display: Ensure all image links are valid

配图数量规范

Illustration Quantity Specifications

  • 推荐:5-8张
  • 最少:3张(题图 + 2张正文图)
  • 最多:不超过10张(避免过度打断阅读)
  • Recommended: 5-8 images
  • Minimum: 3 images (cover image + 2 body images)
  • Maximum: No more than 10 images (avoid excessive reading interruption)

配图位置策略

Illustration Placement Strategy

必配图位置
  • ✅ 题图(封面图):标题下方,必须
  • ✅ 核心章节:每个重点章节配1张
可选配图位置
  • 理论支撑(如引用经典著作)
  • 数据可视化(对比图、图表)
  • 案例补充(产品截图、示例)
Mandatory Placements:
  • ✅ Cover image: Below the title, required
  • ✅ Core chapters: 1 image per key chapter
Optional Placements:
  • Theoretical support (e.g., citing classic works)
  • Data visualization (comparison charts, graphs)
  • Case supplements (product screenshots, examples)

图片来源优先级

Image Source Priority

1️⃣ 公共领域作品(最优先)

1️⃣ Public Domain Works (Highest Priority)

  • 来源:Wikimedia Commons、Google Arts & Culture
  • 适用:经典艺术作品、历史人物肖像、古籍封面
  • 优点:免费、无版权问题、高质量
  • 示例:梵高《星空》、康德肖像
  • 操作:WebFetch获取Wikimedia Commons图片链接
  • Sources: Wikimedia Commons, Google Arts & Culture
  • Applicable: Classic artworks, historical portraits, ancient book covers
  • Advantages: Free, no copyright issues, high quality
  • Examples: Van Gogh's Starry Night, portrait of Kant
  • Operation: Use WebFetch to get Wikimedia Commons image links

2️⃣ AI生成(推荐)

2️⃣ AI Generation (Recommended)

  • 来源:火山引擎 doubao-seedream-4-0-250828
  • 适用:题图、概念图、抽象主题
  • 优点:原创、可定制、快速
  • 操作:调用API生成图片,返回临时URL
  • Source: Volcano Engine doubao-seedream-4-0-250828
  • Applicable: Cover images, concept maps, abstract themes
  • Advantages: Original, customizable, fast
  • Operation: Call API to generate images and return temporary URLs

3️⃣ 免费图库

3️⃣ Free Image Libraries

  • 来源:Unsplash、Pexels、Pixabay
  • 适用:题图、概念图、背景图
  • 优点:免费、高质量、商业可用(CC0)
  • 操作:WebFetch搜索 + 下载
  • Sources: Unsplash, Pexels, Pixabay
  • Applicable: Cover images, concept maps, background images
  • Advantages: Free, high quality, commercially usable (CC0)
  • Operation: WebFetch search + download

4️⃣ 截图/官方素材(需注明来源)

4️⃣ Screenshots/Official Materials (Must Cite Source)

  • 来源:YouTube、B站、产品官网、电影海报
  • 适用:案例图(产品截图、视频截图)
  • 注意:注明来源,合理使用原则
  • 操作:提醒用户自行截图,或生成AI概念图替代
  • Sources: YouTube, Bilibili, official product websites, movie posters
  • Applicable: Case images (product screenshots, video screenshots)
  • Note: Cite the source, follow fair use principles
  • Operation: Remind users to provide screenshots themselves, or generate AI concept images as alternatives

图床上传流程

Image Hosting Upload Process

核心脚本

Core Script

使用项目已有的
/tools/upload_image.py
脚本
Use the existing
/tools/upload_image.py
script in the project

上传方式

Upload Methods

python
undefined
python
undefined

调用上传脚本(在Bash中)

Call upload script (in Bash)

python3 /Users/alchain/Documents/写作/tools/upload_image.py <图片URL或本地路径>
python3 /Users/alchain/Documents/写作/tools/upload_image.py <image URL or local path>

处理网络图片(如AI生成的临时链接)

Process web images (e.g., temporary links from AI generation)

python3 /Users/alchain/Documents/写作/tools/upload_image.py "https://example.com/ai-generated.jpg"
python3 /Users/alchain/Documents/写作/tools/upload_image.py "https://example.com/ai-generated.jpg"

处理本地图片

Process local images

python3 /Users/alchain/Documents/写作/tools/upload_image.py "/Users/alchain/Pictures/image.png"
python3 /Users/alchain/Documents/写作/tools/upload_image.py "/Users/alchain/Pictures/image.png"

脚本自动返回ImgBB永久链接

Script automatically returns permanent ImgBB link

undefined
undefined

容错机制

Fault Tolerance Mechanism

  • ✅ 优先上传到ImgBB图床(永久有效)
  • ⚠️ 上传失败时,自动使用原链接作为fallback
  • 📌 详见
    /tools/README.md
    - 图片上传脚本说明
  • ✅ Prioritize uploading to ImgBB (permanently valid)
  • ⚠️ Automatically use original link as fallback if upload fails
  • 📌 See
    /tools/README.md
    - Image Upload Script Instructions

Markdown插入格式

Markdown Insert Format

markdown
![图片描述](https://i.ibb.co/xxxxx/image.jpg)
  • 使用永久网络链接(不是本地路径)
  • 填写有意义的图片描述(alt text)
  • 图片描述要简洁,突出图片内容
markdown
![Image Description](https://i.ibb.co/xxxxx/image.jpg)
  • Use permanent web links (not local paths)
  • Fill in meaningful image descriptions (alt text)
  • Keep image descriptions concise and highlight content

图片规范

Image Specifications

尺寸规范

Size Specifications

  • 封面图:1200x600px (16:9)
  • 正文图:800-1200px宽
  • 人物/产品:800x800px (1:1)
  • Cover image: 1200x600px (16:9)
  • Body image: 800-1200px wide
  • Character/Product: 800x800px (1:1)

文件规范

File Specifications

  • 格式:JPG(照片)/ PNG(插画)
  • 大小:< 500KB
  • 命名:小写、语义化、英文(如
    mrbeast.jpg
    ,
    starry-night.jpg
  • Format: JPG (photos) / PNG (illustrations)
  • Size: < 500KB
  • Naming: lowercase, semantic, English (e.g.,
    mrbeast.jpg
    ,
    starry-night.jpg
    )

路径规范

Path Specifications

  • ✅ 网络链接:
    https://i.ibb.co/xxxxx/image.jpg
    (推荐,永久有效)
  • ❌ 本地路径:不再使用本地路径(复制到公众号会失效)
  • ✅ Web link:
    https://i.ibb.co/xxxxx/image.jpg
    (recommended, permanently valid)
  • ❌ Local path: No longer use local paths (will fail when copied to official account editor)

版权注意事项

Copyright Notes

  • ✅ 公共领域作品(作者去世70年以上)
  • ✅ CC0许可的图片(Unsplash等)
  • ✅ AI生成的图片(确认工具许可)
  • ⚠️ 截图/官方素材需注明来源
  • ✅ Public domain works (author has been deceased for over 70 years)
  • ✅ CC0-licensed images (Unsplash, etc.)
  • ✅ AI-generated images (confirm tool license)
  • ⚠️ Screenshots/official materials must cite sources

配图检查清单

Illustration Checklist

执行配图任务前,确认以下事项:
  • 文章已审校完成,内容稳定
  • 确定配图数量(5-8张)
  • 确定配图位置(题图+核心章节)
  • 所有图片已获取(AI生成/公共领域/免费图库)
  • 所有图片已上传到ImgBB图床
  • 图片链接为永久网络链接(https:// 开头)
  • 已在Markdown中插入图片(使用网络链接)
  • 图片描述(alt text)已填写
  • 所有图片链接验证通过(可正常访问)
Confirm the following before executing illustration tasks:
  • Article review completed, content stable
  • Determine number of illustrations (5-8)
  • Determine illustration positions (cover + core chapters)
  • All images obtained (AI-generated / public domain / free libraries)
  • All images uploaded to ImgBB
  • Image links are permanent web links (start with https://)
  • Images inserted into Markdown (using web links)
  • Image descriptions (alt text) filled in
  • All image links verified (accessible)

执行步骤(5步标准流程)

Execution Steps (5-Step Standard Process)

Step 1: 分析文章,确定配图需求

Step 1: Analyze Article, Determine Illustration Requirements

  • 通读全文,标记重点章节
  • 列出配图需求清单(6-8项)
  • 确定每张图的位置和作用
  • Read the full article, mark key chapters
  • List illustration requirement checklist (6-8 items)
  • Determine position and purpose of each image

Step 2: 获取/生成图片

Step 2: Obtain/Generate Images

根据图片来源优先级获取图片:
  1. 公共领域作品 → WebFetch获取
  2. AI生成 → 调用API生成
  3. 免费图库 → WebFetch搜索
  4. 截图素材 → 提醒用户提供
Obtain images according to source priority:
  1. Public domain works → Fetch via WebFetch
  2. AI-generated → Call API to generate
  3. Free image libraries → Search via WebFetch
  4. Screenshot materials → Remind users to provide

Step 3: 上传到图床,获取永久链接

Step 3: Upload to Image Hosting, Get Permanent Links

bash
undefined
bash
undefined

对每张图片调用上传脚本

Call upload script for each image

python3 /Users/alchain/Documents/写作/tools/upload_image.py <图片URL>
undefined
python3 /Users/alchain/Documents/写作/tools/upload_image.py <image URL>
undefined

Step 4: 在文章中插入图片

Step 4: Insert Images into Article

markdown
![图片描述](https://i.ibb.co/xxxxx/image.jpg)
markdown
![Image Description](https://i.ibb.co/xxxxx/image.jpg)

Step 5: 验证显示

Step 5: Validate Display

bash
undefined
bash
undefined

检查所有图片引用

Check all image references

grep -n "![" "文章路径.md"
grep -n "![" "article-path.md"

所有图片链接应该是 https:// 开头的网络链接

All image links should be web links starting with https://

undefined
undefined

参考资源

Reference Resources

  • /tools/README.md
    - 图片上传脚本使用说明
  • /tools/upload_image.py
    - 图片上传脚本
  • /公众号写作/AI文生图API调用.md
    - AI文生图API说明
  • /公众号写作/images/useless-content/配图Best Practice总结.md
    - 配图最佳实践
  • /tools/README.md
    - Image Upload Script Instructions
  • /tools/upload_image.py
    - Image Upload Script
  • /公众号写作/AI文生图API调用.md
    - AI Image Generation API Instructions
  • /公众号写作/images/useless-content/配图Best Practice总结.md
    - Illustration Best Practices Summary

常见问题

Frequently Asked Questions

Q1: AI生成的图片临时链接会失效吗?

Q1: Will temporary links of AI-generated images expire?

A: 会。所以必须调用
upload_image.py
上传到ImgBB,获取永久链接。
A: Yes. So you must call
upload_image.py
to upload to ImgBB and get permanent links.

Q2: 如果图床上传失败怎么办?

Q2: What if image hosting upload fails?

A: 脚本有容错机制,会自动fallback到原URL。但建议检查ImgBB API配置。
A: The script has a fault tolerance mechanism and will automatically fallback to the original URL. But it's recommended to check ImgBB API configuration.

Q3: 每篇文章必须配图吗?

Q3: Is it mandatory to add illustrations to every article?

A: 推荐配图,特别是长文(3000字以上)。但短文(1000字以下)可以只配题图。
A: Recommended, especially for long articles (over 3000 words). Short articles (under 1000 words) can only have a cover image.

Q4: 可以使用本地图片路径吗?

Q4: Can I use local image paths?

A: 不推荐。本地路径在复制到公众号编辑器后会失效,必须使用网络链接。
A: Not recommended. Local paths will fail when copied to official account editors, so web links must be used.

技术依赖

Technical Dependencies

  • Python脚本:
    /tools/upload_image.py
    (已有)
  • API配置: ImgBB API key(已配置在
    ~/.zshrc
  • AI生成API: 火山引擎 doubao-seedream(可选)
  • 工具: WebFetch(获取公共领域图片)
  • Python Script:
    /tools/upload_image.py
    (existing)
  • API Configuration: ImgBB API key (configured in
    ~/.zshrc
    )
  • AI Generation API: Volcano Engine doubao-seedream (optional)
  • Tool: WebFetch (obtain public domain images)

成功案例

Success Cases

  • 《为什么最好的内容都是无用的》:6张配图(2张公共领域 + 4张AI生成)
  • 《DeepSeek-OCR深度评测》:5张配图,全部上传到ImgBB,复制到公众号无压力

最后更新: 2025-11-07 适用项目: 公众号写作 维护者: 花生

花叔出品 | AI Native Coder · 独立开发者 公众号「花叔」| 30万+粉丝 | AI工具与效率提升 代表作:小猫补光灯(AppStore付费榜Top1)·《一本书玩转DeepSeek》
  • 《Why the Best Content is Useless》: 6 illustrations (2 public domain + 4 AI-generated)
  • 《DeepSeek-OCR In-depth Evaluation》: 5 illustrations, all uploaded to ImgBB, no issues when copied to official account

Last Updated: 2025-11-07 Applicable Project: Official Account Writing Maintainer: Huasheng

Produced by Uncle Hua | AI Native Coder · Independent Developer Official Account "Uncle Hua" | 300k+ Followers | AI Tools & Efficiency Improvement Masterpieces: Kitten Fill Light (Top 1 in AppStore Paid List) · Mastering DeepSeek in One Book