Token导航 LogoToken导航TokenDH.com
图像处理需要联网github未标认证来源可访问许可证需确认审计提醒

designing-canvas-images设计画布图像

Agent Skill

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

总安装

343

周安装

14

GitHub Stars

4,770

下载量

111
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dtyq/magic --skill designing-canvas-images

简介

该技能提供 AI 图像生成、网页图片搜索与设计标记处理能力。

  • 支持文本转图片、背景替换与提示词优化,适用于视觉素材创作与编辑场景。
  • 所有 Python 代码必须通过 exec_python 执行,需遵守输入输出格式与模型限制规则。
  • 涉及人物或品牌素材时应核对版权,避免生成敏感内容,建议本地预览输出结果。
  • designing-canvas-images 属于图像处理类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Canvas Image Design Skill

Provides AI image generation, web image search and download, and design marker processing capabilities.


How to Use This Document

This document provides quick guidance covering basic usage and core rules. When encountering the following situations, read the corresponding reference documentation:


Code Execution Method (Critical)

All Python code examples in this skill must be executed via the run_skills_snippet tool in Agent environment.

Correct example:

# Correct! Must use run_skills_snippet to execute
run_skills_snippet(
    python_code="""
from sdk.tool import tool
result = tool.call('create_design_project', {
    "project_path": "my-design"
})
"""
)

All code blocks in this document starting with from sdk.tool import tool follow this rule: pass them via the python_code parameter of run_skills_snippet for execution.


Quick Start

Create a new canvas project:

from sdk.tool import tool

result = tool.call('create_design_project', {
    "project_path": "my-design"
})

Generate AI images:

from sdk.tool import tool

result = tool.call('generate_images_to_canvas', {
    "project_path": "my-design",
    "name": "北京景点",
    "prompts": ["长城全景,专业摄影", "故宫太和殿,专业摄影", "天坛祈年殿,专业摄影"],
    "size": "2048x2048"
})

Query canvas overview:

from sdk.tool import tool

result = tool.call('query_canvas_overview', {
    "project_path": "my-design",
    "sort_by": "layer"
})

Query element by image path:

from sdk.tool import tool

result = tool.call('query_canvas_element', {
    "project_path": "my-design",
    "src": "my-design/images/cat.jpg"
})

Core Tools and Required Parameters

create_design_project - Create Canvas Project

ParameterRequiredDescription
project_pathYesProject relative path, e.g., "my-design"

Return data (result.data):

FieldTypeDescription
project_pathstringProject path
project_namestringProject name

generate_images_to_canvas - Generate AI Images

ParameterRequiredDescription
project_pathYesProject path
nameYesElement name, automatically adds suffix _1, _2 for multiple images
promptsYesList of prompts (max 6 prompts for multiple prompts mode)
sizeYesImage size, format: 'widthxheight', e.g., "2048x2048", "2560x1440"
image_countNoNumber of images in a set, max 4 (mutually exclusive with multiple prompts)
image_pathsNoReference image paths (used for image-to-image generation)

Return data (result.data):

FieldTypeDescription
created_elementsarrayCreated element list, each contains {id, name, type, x, y, width, height}
succeeded_countnumberNumber of successfully generated images
failed_countnumberNumber of failed images

query_canvas_overview - Query Canvas Overview

ParameterRequiredDescription
project_pathYesProject path
sort_byNoSort method: "layer", "position", "type"
visible_onlyNoWhether to show only visible elements

Return data (result.data):

FieldTypeDescription
elementsarrayElement list, each contains {id, name, type, size, position}
canvas_info.total_elementsnumberTotal element count
project_namestringProject name

query_canvas_element - Query Element Details

ParameterRequiredDescription
project_pathYesProject path
element_idNoElement ID (choose one between element_id and src)
srcNoImage path (choose one between element_id and src, used to find element by image path)

Return data (result.data):

FieldTypeDescription
size{width, height}Element size, use for image-to-image
image_properties.srcstringImage path (for image elements)
idstringElement ID
namestringElement name

Key Rules

Coordinate System

Canvas uses absolute coordinate system:

  • Coordinate origin: Canvas top-left corner is (0, 0)
  • Coordinate direction: X-axis increases rightward, Y-axis increases downward
  • x, y coordinate meaning: Represents the top-left corner position of the element (absolute coordinates relative to canvas)
  • Infinite canvas: Elements can be placed at any position

Image Processing Principles

  1. Do not modify original image files - All content changes must create new elements
  2. Do not delete elements - Never delete elements under any circumstances
  3. Do not modify image content through properties - Cannot change image content in any way (e.g., changing colors, adding text)
  4. Use generate_images_to_canvas for content changes - Create new elements while keeping original elements unchanged
  5. "Add XX to image" means image-to-image - Generate images containing new content, NOT create separate XX element on canvas

Operation Flow Principles

  1. Canvas Selection: By default, use the same canvas - Unless user explicitly requests a new canvas

- Prioritize finding or reusing existing projects, avoid unnecessary project creation - Only create new projects when user explicitly expresses intent like "create new canvas" or "create new project"

  1. Must query existing canvases before operations - Use query_canvas_overview
  2. Do not assume file paths - Must reference paths based on query results
  3. Query original image size before image-to-image - Use query_canvas_element with src parameter

Image Size Guide

Size format: 'widthxheight', e.g., '2048x2048'

Available sizes: Select from "当前图片生成模型可用的尺寸选项" in the user message

Common sizes (use when no available sizes in configuration):

  • '2048x2048' - 2K square (recommended, suitable for most scenarios)
  • '2304x1728' - Horizontal rectangle
  • '1728x2304' - Vertical rectangle
  • '2560x1440' - 16:9 horizontal
  • '1440x2560' - 9:16 vertical
  • '2496x1664' - 3:2 horizontal
  • '1664x2496' - 2:3 vertical
  • '3024x1296' - Ultra-wide horizontal

Image-to-image size handling:

  • If user hasn't explicitly requested a specific size, use the reference image's original size
  • If user explicitly specified a size, use the user-specified size

AI Generation Mode Selection

Mode 1: Independent Images of Different Themes

Generate images of different themes → Use multiple prompts (max 6)

from sdk.tool import tool

result = tool.call('generate_images_to_canvas', {
    "project_path": "landmarks",
    "name": "北京景点",
    "prompts": ["长城全景", "故宫太和殿", "天坛祈年殿", "颐和园昆明湖"],
    "size": "2048x2048"
}))

Mode 2: Style-Consistent Variants (Set)

Generate style-consistent variants → Use single prompt + image_count (max 4)

from sdk.tool import tool

result = tool.call('generate_images_to_canvas', {
    "project_path": "product",
    "name": "产品图",
    "prompts": ["产品摄影,多角度展示"],
    "image_count": 4,
    "size": "2048x2048"
}))

Mode 3: Image-to-Image (Based on Reference)

Generate new images based on existing images, suitable for design modifications or processing design markers.

Important: Must query original image size before image-to-image and use the same size

# Step 1: Query original image size by src
from sdk.tool import tool

result = tool.call('query_canvas_element', {
    "project_path": "my-design",
    "src": "my-design/images/cat.jpg"
})

# Step 2: Use result.data to get original size
if result.ok and result.data:
    width = result.data['size']['width']
    height = result.data['size']['height']
    src = result.data['image_properties']['src']

    # Step 3: Generate with same size
    result2 = tool.call('generate_images_to_canvas', {
        "project_path": "my-design",
        "name": "修改后的猫",
        "image_paths": [src],
        "prompts": ["将右上角的耳朵改为红色,保持其他部分不变"],
        "size": f"{width}x{height}"
    })

Image-to-Image Core Principles

When user provides reference images, follow these core principles:

  1. Must use reference images - Include image_paths parameter, emphasize visual consistency in prompts
  2. Maintain subject integrity - Don't add content not in original, keep product count and types consistent
  3. Separate subject from style - Can change photography style, background, lighting, but not subject's features
  4. Precise requirement delivery - Write every user keyword into Prompt, clearly state how to use reference
Need detailed explanation? For complex image-to-image scenarios (e.g., product design, brand consistency requirements), read: reference/image-generation.md

Design Marker Processing

What is Design Marker

Users mark areas on images that need modification or content addition. Format: [@design_marker:marker_name]

Example information:

[@design_marker:红色耳朵]
- Image location: my-design/images/dog.jpg
- Marked area: Small area at top right of image
- Coordinates: Top left (64.0%, 7.0%)

Processing Steps

  1. Parse marker information - Extract image location, marked area, user requirements from marker
  2. Query original image size - Use query_canvas_element(src=...)
  3. Construct Prompt - [location] + [modification] + [keep original]
  4. Call image-to-image - Use generate_images_to_canvas with image_paths parameter
Important: If user message contains [@design_marker:xxx] markers, MUST read detailed processing workflow: reference/design-marker.md

Tool Selection Decision Tree

Need to create new canvas?
├─ Yes → create_design_project
└─ No → Continue

Need to generate AI images?
├─ Yes → generate_images_to_canvas
│   ├─ Have reference? → First query_canvas_element (src) to get size
│   ├─ Different themes? → Multiple prompts
│   └─ Style-consistent? → Single prompt + image_count
└─ No → Continue

Need to search web images?
├─ Yes → See reference/image-search.md
└─ No → Continue

Need to query information?
├─ Canvas overview → query_canvas_overview
├─ Element details (known ID) → query_canvas_element (element_id)
└─ Element details (known image path) → query_canvas_element (src)

Web Image Search

To use web image search: See reference/image-search.md

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.69%
按下载量换算43

Claude

27.41%
按下载量换算30

Cursor

16.82%
按下载量换算19

Gemini CLI

9.04%
按下载量换算10

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills