transformation-builder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTransformation Builder Skill
Transformation Builder Skill
Understand how the tool works, write a precise query, order multi-step chains correctly, then call .
transformation_builder了解该工具的工作原理,编写精准的查询语句,正确排序多步骤转换链,然后调用。
transformation_builderHow this tool actually works (read this first)
工具实际工作原理(请先阅读)
transformation_buildertransformation_builder(query, src?, previous_errors?)- — a natural-language description of the desired transformation.
query - — optional ImageKit-hosted source URL (defaults to a sample image).
src - — pass the error text from a prior failed call so the tool can self-correct.
previous_errors
Internally the tool: (1) searches ImageKit docs using your , (2) an LLM turns it into a validated list of transformation steps, (3) the SDK builds the final URL. There is no argument — the parameter names below are vocabulary to put into your query, not API fields you set directly. Because step 1 is a doc search over your query text, using the correct ImageKit parameter names and values in the query materially improves the result. Using wrong/invented names sends the search off course.
querycapabilitySo your job is: translate the user's vague request into a precise query that references real parameters and values from the reference section below.
transformation_buildertransformation_builder(query, src?, previous_errors?)- — 对所需转换效果的自然语言描述。
query - — 可选的ImageKit托管源URL(默认使用示例图片)。
src - — 传入之前调用失败的错误文本,以便工具自我纠正。
previous_errors
工具内部流程:(1) 使用你的搜索ImageKit文档,(2) 大语言模型将其转换为经过验证的转换步骤列表,(3) SDK构建最终URL。此工具没有参数——下方的参数名称是需要放入查询语句的词汇,而非直接设置的API字段。由于第一步是对查询文本进行文档搜索,在查询中使用正确的ImageKit参数名称和值能显著提升结果质量。使用错误/虚构的名称会导致搜索偏离方向。
querycapability因此你的任务是:将用户模糊的需求转换为精准的查询语句,引用下方参考部分中的真实参数和值。
When to use (triggers this skill)
使用场景(触发此技能)
- Resize, crop, or focus on a region
- Filters, effects, overlays (image/text/video), watermarks
- Multi-step transformation chains
- Background removal, replacement, or generative fill
- Any AI-powered image editing (change objects/colors/styles, upscale, retouch, drop shadow, variations)
- 调整大小、裁剪或聚焦特定区域
- 滤镜、特效、叠加层(图像/文字/视频)、水印
- 多步骤转换链
- 背景移除、替换或生成式填充
- 任何AI驱动的图像编辑(更改对象/颜色/样式、放大、润色、投影、变体)
Calling transformation_builder
transformation_builder调用transformation_builder
transformation_builder- : the precise, rewritten description (see Query Crafting). Never pass the user's vague words through unchanged.
query - : the ImageKit delivery URL to transform, if the user gave one. Must be ImageKit-hosted.
src - Frame a multi-step request as one query describing the steps in order:
- User: "1) Resize to 800x600 2) Crop to the face"
- Query: "Resize to width 800 and height 600, then crop with focus on the face"
- :经过精准改写的描述(参见查询语句编写)。切勿直接传递用户模糊的原始表述。
query - :用户提供的待转换ImageKit交付URL(必须是ImageKit托管的)。
src - 将多步骤请求整理为一个查询语句,按顺序描述步骤:
- 用户:"1) 调整为800x600 2) 裁剪至人脸区域"
- 查询语句:"调整宽度为800、高度为600,然后以人脸为焦点进行裁剪"
Query Crafting
查询语句编写
Rule: rewrite the vague request into a description that names real parameters and values. Use exact parameter names/values when you know them; fall back to plain English only when unsure.
| User says | Weak query | Good query |
|---|---|---|
| "Make the red balls green" | "make red balls green" | "Apply an AI edit ( |
| "Clean it up and put it on white" | "clean up, white background" | "Apply |
| "Make it look like a painting" | "painting style" | "Apply |
| "Crop around the face" | "crop face" | "Resize with |
| "Text 'Hello' at the bottom" | "add hello text" | "Add a text overlay with text 'Hello', positioned at the bottom ( |
| "Fit a mobile banner" | "mobile banner" | "Resize to |
| "300px wide with a red border" | "resize and border" | "Resize to |
| "Higher resolution, it's blurry" | "fix quality" | "Apply |
| "Remove bg and add a shadow" | "remove bg shadow" | "Apply |
| "Make it wider without stretching" | "make wider" | "Extend the canvas horizontally using a padded crop ( |
规则:将模糊的需求改写为提及真实参数和值的描述。已知参数名称/值时使用准确表述;不确定时再退而使用直白英语。
| 用户表述 | 欠佳的查询语句 | 优质的查询语句 |
|---|---|---|
| "把红球改成绿色" | "make red balls green" | "应用AI编辑( |
| "清理图片并放在白色背景上" | "clean up, white background" | "应用 |
| "让它看起来像油画" | "painting style" | "应用 |
| "裁剪人脸区域" | "crop face" | "使用 |
| "在底部添加文字'Hello'" | "add hello text" | "添加文字叠加层,内容为'Hello',位置设置为底部( |
| Fit a mobile banner" | "mobile banner" | "调整宽度为 |
| "300px宽并添加红色边框" | "resize and border" | "调整宽度为 |
| "分辨率更高一点,图片模糊" | "fix quality" | "应用 |
| "移除背景并添加阴影" | "remove bg shadow" | "应用 |
| "加宽图片但不拉伸" | "make wider" | "使用填充裁剪( |
Intent → real parameter/vocabulary
需求 → 真实参数/词汇
Use this to translate intent into the correct terms to put in the query. These are the actual parameter names the tool validates against.
| User intent | Use this vocabulary | Notes |
|---|---|---|
| Modify specific objects/regions ("enlarge the cat", "add sunglasses", "make it a painting") | | AI content edit driven by a text prompt |
| Replace the whole background scene ("put them on a beach") | | Keeps the subject, generates a new scene. Not for plain removal or color changes |
| Remove background → transparent | | ImageKit-native. For the external remove.bg engine use |
| Extend/outpaint the canvas ("add more sky", "make it panoramic") | padded crop + | Generative fill lives in the background param, not a standalone AI field. Takes no prompt |
| Increase resolution / fix low-res | | Boolean; no params |
| Clean up / remove blemishes | | Boolean; no params |
| Realistic shadow under a cut-out subject | | Transparent images only. Optional |
| Different version / remix | | Boolean; preserves structure |
| Resize / aspect ratio / crop | | See Resize & Crop table |
| Smart crop to face/object | | Object names are COCO classes ( |
| Swap one color across all pixels ("all red → blue") | | Global pixel color swap with |
| Filters/adjustments (B&W, blur, sharpen, rotate, border, round corners) | | See Effects table |
| Overlay a logo/watermark image | text/image overlay | Single |
| Write text on the image | text overlay with | See Overlays |
There is no "generate an image from scratch" step in this tool — it always transforms an existing. To generate images from scratch, use text-to-image generation in the ImageKit DAM (Digital Asset Manager), which is a separate feature fromsrc.transformation_builder
使用下表将用户需求转换为查询语句中应使用的正确术语。这些是工具会验证的实际参数名称。
| 用户需求 | 使用以下词汇 | 说明 |
|---|---|---|
| 修改特定对象/区域("放大猫"、"添加太阳镜"、"改成油画风格") | | 由文本提示词驱动的AI内容编辑 |
| 替换整个背景场景("把他们放在海滩上") | | 保留主体,生成新场景。不适用于单纯移除背景或更改背景颜色 |
| 移除背景 → 透明 | | ImageKit原生功能。如需使用外部remove.bg引擎,请使用 |
| 扩展画布("添加更多天空"、"改为全景图") | 填充裁剪 + | 生成式填充属于background参数,而非独立的AI字段。无需提示词 |
| 提高分辨率/修复低分辨率图片 | | 布尔值;无额外参数 |
| 清理/去除瑕疵 | | 布尔值;无额外参数 |
| 为抠图主体添加逼真阴影 | | 仅适用于透明图片。可选参数 |
| 生成不同版本/ remix | | 布尔值;保留原图结构 |
| 调整大小/宽高比/裁剪 | | 请查看调整大小与裁剪表格 |
| 智能裁剪至人脸/物体 | | 物体名称为COCO类别( |
| 替换所有像素中的某一种颜色("所有红色→蓝色") | | 全局像素颜色替换,支持 |
| 滤镜/调整(黑白、模糊、锐化、旋转、边框、圆角) | | 请查看特效表格 |
| 叠加logo/水印图片 | text/image overlay | 统一使用 |
| 在图片上添加文字 | text overlay + | 请查看叠加层部分 |
此工具没有"从头生成图片"的功能——它始终转换现有图片。如需从头生成图片,请使用ImageKit DAM(数字资产管理器)中的文本生成图片功能,这是独立于src的功能。transformation_builder
Key distinction: ai_edit
vs color_replace
vs ai_change_background
ai_editcolor_replaceai_change_background关键区别:ai_edit
vs color_replace
vs ai_change_background
ai_editcolor_replaceai_change_background- Changing specific objects/regions ("make the balls bigger", "turn the car red") →
ai_edit - Swapping one color globally across all pixels ("replace all red with blue") →
color_replace - Replacing the entire background scene ("put them on a beach") →
ai_change_background
- 修改特定对象/区域("放大球"、"把车改成红色")→
ai_edit - 全局替换某一种颜色("将所有红色替换为蓝色")→
color_replace - 替换整个背景场景("把他们放在海滩上")→
ai_change_background
Ordering multi-step chains
多步骤转换链排序
When a request spans multiple operations, chain them in one query in this order:
- Upscale / retouch (quality first)
- AI content edits ()
ai_edit - Background removal / replacement (,
ai_remove_background)ai_change_background - Resize / crop (final dimensions)
- Effects / overlays (finishing touches)
Critical: background removal goes AFTER upscale/retouch, never before.
Correct: . Wrong: .
ai_upscale → ai_remove_backgroundai_remove_background → ai_upscaleExample — "clean up this photo, remove the background, make it 500x500":
→ Query: "Apply , then , then resize to =500 and =500".
ai_retouchai_remove_backgroundwidthheight当请求包含多个操作时,按以下顺序将它们整合到一个查询语句中:
- 放大/润色(优先保证质量)
- AI内容编辑()
ai_edit - 背景移除/替换(,
ai_remove_background)ai_change_background - 调整大小/裁剪(最终尺寸)
- 特效/叠加层(收尾处理)
重要提示:背景移除操作应在放大/润色之后进行,切勿提前。
正确顺序:。错误顺序:。
ai_upscale → ai_remove_backgroundai_remove_background → ai_upscale示例——"清理这张照片,移除背景,调整为500x500":
→ 查询语句:"应用,然后应用,最后调整宽度为=500、高度为=500"。
ai_retouchai_remove_backgroundwidthheightBackground removal: clarify intent
背景移除:明确需求
- If the user says "remove background" ambiguously, ask whether they want:
- Real-time URL — in a delivery URL (nothing stored).
ai_remove_background - Remove and save — apply the background-removal extension and upload the result as a new file version (a media-library operation, not this tool).
- Real-time URL —
- Only use when they want a new background scene. For a plain transparent cut-out or a solid color, use
ai_change_background(optionally followed byai_remove_background=a color).background
- 如果用户模糊地说"移除背景",请询问他们需要:
- 实时URL — 在交付URL中使用(无存储操作)。
ai_remove_background - 移除并保存 — 应用背景移除扩展并将结果作为新版本文件上传(这是媒体库操作,不属于此工具)。
- 实时URL — 在交付URL中使用
- 仅当用户需要新的背景场景时使用。如需生成透明抠图或纯色背景,请使用
ai_change_background(可选择性添加ai_remove_background=颜色参数)。background
Handling failures
处理调用失败
- 400 / Bad Request or validation error: refine the query and retry, passing the error text as . Invoke the
previous_errorsskill and callsearch-docsto confirm supported parameters/limits.search_docs - 3+ failures: use to find supported methods and constraints before retrying.
search-docs - Unsupported: confirm via docs and offer the closest supported alternative.
- 400 / 请求错误或验证错误:优化查询语句并重试,将错误文本作为传入。调用
previous_errors技能,使用search-docs确认支持的参数/限制。search_docs - 失败3次及以上:在重试前使用查找支持的方法和约束条件。
search-docs - 不支持的需求:通过文档确认后,提供最接近的支持方案。
Gotchas
注意事项
- Source URL must be ImageKit-hosted.
- Background removal order matters (upscale/retouch first).
- Generative fill = =
backgroundon a padded/enlarged canvas; it takes no prompt.genfillis the prompt-driven one.ai_change_background - needs a transparent subject (run
ai_drop_shadowfirst).ai_remove_background - Negative offsets/rotation are written with an prefix in the final URL (the tool handles this) — just describe the value normally.
N
- 源URL必须是ImageKit托管的。
- 背景移除的顺序至关重要(先放大/润色)。
- 生成式填充 = 在扩展/填充的画布上设置=
background;无需提示词。genfill是基于提示词的背景替换功能。ai_change_background - 需要透明主体(需先运行
ai_drop_shadow)。ai_remove_background - 最终URL中负偏移/旋转值带有前缀(工具会自动处理)——只需正常描述数值即可。
N
Parameter reference
参数参考
These are the real names/values the tool validates. Put them into your query.
这些是工具会验证的真实名称/值。请将它们放入查询语句中。
Resize & crop
调整大小与裁剪
| Parameter | What it does |
|---|---|
| Output width. Integer px, decimal 0–1 (fraction of original), or an arithmetic expression. |
| Output height. Same formats as |
| Aspect ratio (e.g. |
| Resize strategy: |
| Pad/extract behavior: |
| Focal point: |
| Zoom factor around the focused area (with face/object focus). |
| Region coordinates for |
| Device pixel ratio (number or |
| Fill for padded areas — see Background modes. |
| 参数 | 功能 |
|---|---|
| 输出宽度。支持整数像素、0–1的小数(相对于原图的比例)或算术表达式。 |
| 输出高度。格式与 |
| 宽高比(例如 |
| 调整策略: |
| 填充/提取行为: |
| 焦点: |
| 焦点区域的缩放系数(适用于人脸/物体聚焦)。 |
| |
| 设备像素比(数字或 |
| 填充区域的背景模式——请查看背景模式部分。 |
Background modes (background
)
background背景模式(background
)
background| Value | Meaning |
|---|---|
| a color | Hex ( |
| Blurred version of the image (optionally |
| The image's dominant color. |
| AI generative fill of the padded area (outpainting). No prompt. |
| Gradient from dominant colors ( |
| 值 | 含义 |
|---|---|
| 颜色值 | 十六进制( |
| 图片的模糊版本(可选格式 |
| 图片的主色调。 |
| AI生成式填充填充区域(向外扩展绘画)。无需提示词。 |
| 基于主色调的渐变( |
AI transforms
AI转换
| Parameter | What it does |
|---|---|
| ImageKit-native background removal → transparent. |
| Background removal via external provider (remove.bg). |
| Prompt-based AI edit of image content. |
| Prompt-based replacement of the background scene (subject preserved). |
| AI drop shadow (transparent images only). Optional |
| AI super-resolution upscaling. No params. |
| AI quality enhancement / blemish removal. No params. |
| Generate a structural variation of the image. No params. |
| 参数 | 功能 |
|---|---|
| ImageKit原生背景移除 → 透明。 |
| 通过外部服务商(remove.bg)移除背景。 |
| 基于提示词的AI图像内容编辑。 |
| 基于提示词的背景场景替换(保留主体)。 |
| AI投影(仅适用于透明图片)。可选参数 |
| AI超分辨率放大。无额外参数。 |
| AI质量增强/瑕疵去除。无额外参数。 |
| 生成图片的结构变体。无额外参数。 |
Effects & enhancement
特效与增强
| Parameter | What it does |
|---|---|
| Gaussian blur, 0–100. |
| Sharpen, 0–100. |
| Advanced sharpening ( |
| Convert to grayscale. |
| Auto-enhance contrast. |
| Drop shadow under non-transparent pixels (needs transparency). Optional |
| Linear gradient overlay ( |
| Replace a color and similar shades: |
| Tint the image: |
| Border of |
| Trim solid edges around the subject. |
| Rotate by degrees (or |
| |
| Round corners (integer, |
| Layer opacity, 0–100. |
| Perspective warp (4 coordinate pairs) or arc distortion (degrees). |
| 参数 | 功能 |
|---|---|
| 高斯模糊,取值0–100。 |
| 锐化,取值0–100。 |
| 高级锐化( |
| 转换为灰度图。 |
| 自动增强对比度。 |
| 为非透明像素添加投影(需要透明区域)。可选参数 |
| 线性渐变叠加层( |
| 替换颜色及相似色调: |
| 为图片着色: |
| 设置 |
| 裁剪主体周围的纯色边缘。 |
| 旋转角度(或从EXIF自动获取 |
| |
| 圆角(整数, |
| 图层透明度,取值0–100。 |
| 透视变形(4组坐标)或弧形变形(角度)。 |
Overlays (overlay
)
overlay叠加层(overlay
)
overlayOne concept with a typed shape. Each overlay supports (, , , , , ), for video (, , ), (, , , ), and a nested list.
overlaypositionxyx_centery_centerfocusanchor_pointtimingstartenddurationlayer_modemultiplycuttercutoutdisplacetransformation| Overlay type | Key fields |
|---|---|
| Text | |
| Image | |
| Video | |
| Subtitle | |
| Solid color | |
统一使用概念,区分不同类型。每个叠加层支持(, , , , , )、视频(, , )、(, , , ),以及嵌套的列表。
overlaypositionxyx_centery_centerfocusanchor_pointtimingstartenddurationlayer_modemultiplycuttercutoutdisplacetransformation| 叠加层类型 | 关键字段 |
|---|---|
| 文本 | |
| 图像 | |
| 视频 | |
| 字幕 | |
| 纯色 | |
Video transforms
视频转换
| Parameter | What it does |
|---|---|
| Trim the clip (seconds or arithmetic expressions). |
| |
| |
| Adaptive-bitrate ladder, e.g. |
| Same as image effects, applied to the video frame. |
| 参数 | 功能 |
|---|---|
| 裁剪视频片段(秒或算术表达式)。 |
| |
| |
| 自适应比特率阶梯,例如 |
| 与图像特效相同,应用于视频帧。 |
Output & delivery
输出与交付
| Parameter | What it does |
|---|---|
| |
| 0–100. |
| Progressive JPEG. |
| Lossless WebP/PNG. |
| Apply a saved named transformation. |
| Fallback image if the source is missing. |
| 参数 | 功能 |
|---|---|
| |
| 0–100。 |
| 渐进式JPEG。 |
| 无损WebP/PNG。 |
| 应用已保存的命名转换。 |
| 源图片缺失时的 fallback 图片。 |
Conditionals
条件转换
Transformations can be conditional on image properties (e.g. width/height/aspect ratio) — describe the condition in plain language ("if width > 1000, then …") and the tool builds the // chain.
ifif-elseif-end转换操作可基于图片属性(如宽度/高度/宽高比)设置条件——用直白语言描述条件("如果宽度>1000,则……"),工具会构建//链。
ifif-elseif-end