← 返回
内容创作 中文

Color Palette Generator

Extract a color palette from an image and return HEX/RGB values with optional swatch image.
从图像提取配色,返回 HEX/RGB 值及可选色卡图像。
qrost
内容创作 clawhub v1.1.1 1 版本 99749 Key: 无需
★ 1
Stars
📥 1,967
下载
💾 46
安装
1
版本
#latest

概述

Color Palette

Extract dominant colors from a photo and get HEX/RGB values for use in design tools or mood boards.

Dependencies

  • Pillow (image handling; required)
  • colorgram (optional; better dominant-color extraction; pip install colorgram.py)
  • matplotlib (optional; only if generating swatch image with --output)

Setup: OpenClaw does not install Python packages automatically. After installing this skill, run once: pip install -r requirements.txt (from the skill folder or pass the path). If a script fails with ModuleNotFoundError, install the missing package.

Usage

Extract palette from an image

Parameters:

  • image: Path to the image file (JPEG, PNG, etc.).
  • -n, --num-colors: Number of colors to extract (default 5, max 20).
  • --output: Optional path to save a swatch PNG.
python3 scripts/extract_palette.py /path/to/photo.jpg
python3 scripts/extract_palette.py /path/to/photo.jpg -n 8 --output palette_swatch.png

Output: one line per color with HEX and RGB (e.g. #2A4B7C RGB(42, 75, 124)). If --output is set, a simple swatch image is saved.

Sending images to Telegram

These skills are used from the OpenClaw Telegram conversation. To show the user a picture, the agent must (1) run the script with an image output path (PNG or JPG), then (2) send that file to the conversation using the OpenClaw message/media tool. For this skill: use --output .png so you have an image to send; then send that PNG to the user.

OpenClaw allowed paths: The message tool only sends files from allowed dirs (~/.openclaw/media/, ~/.openclaw/agents/, or system temp e.g. /tmp). Use e.g. --output ~/.openclaw/media/palette.png or --output /tmp/palette.png; do not use the skill install directory or sending will fail.

Agent behavior: When the user asks to extract colors from an image (or sends an image for a palette), run the script directly with exec: save the image to a temp path if needed, run extract_palette.py -n --output .png with under an allowed dir, return the HEX/RGB text and send the swatch PNG. Do not ask for confirmation; execute and return the palette and image.

Examples

User: "Extract 5 colors from this image" (with image attached).

Action: Save the image to a temp path, run extract_palette.py -n 5 --output /tmp/palette.png, return the HEX/RGB list and send the swatch PNG.

User: "Give me a color palette from [image] and save the swatch as swatch.png."

Action: Run with --output swatch.png, return the palette text and send the image.

版本历史

共 1 个版本

  • v1.1.1 当前
    2026-03-29 03:48 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Map Grabber

qrost
获取地址的 OpenStreetMap 矢量(街道、建筑)并导出为 SVG、GeoPackage 或 DXF,供 CAD/Rhino 使用。
★ 1 📥 1,380
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,152
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 858 📥 199,487