editor-b-cover
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "editor-b-cover" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-e65996870eac5f97c6fcb76a4693fd82407bbe415dd9c822dc383c1d79074c23. Verify the upstream source and version against https://skillhub.cn/skills/user_864c7469/editortan-book-cover before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Book cover design Skill (published by Tan on 2026-07-22). For book and journal cover/back cover design: user submits a cover PDF containing only text, logo and barcode (no background image) plus a cover theme description. The skill extracts exact page dimensions, generates a high-resolution, text-free background image matching the theme, and inserts it as a background layer at the bottom of the PDF while keeping the original PDF text and graphics as selectable vectors. Supports landscape/portrait/square covers; people default to Chinese appearance, main subject must be in the lower right half and must not cross the centerline, with left side left blank for title. Style must be vivid and varied, not monotonous. Outputs layered PDF and pure background PNG. Trigger phrases: book cover, cover background, substrate image, add background, design a cover background.
Introduction source: third_party · user_864c7469 · 1.0.3 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- <python_path> <skill_path>/scripts/prepare_background.py <RAW_imagegen.png> <cover-background.png> \ --width-pt <W> --height-pt <H> --dpi 300 --oversize 1.18
- Testing
- Not tested
Browse files
Frontmatter
name: editor-b-cover
description: "谭编于2026年7月22日发布【图书封面设计Skill】。本技能用于图书、期刊的封底、封面设计:用户发送一份仅含文字、LOGO和条码等元素的封面 PDF(无底图)以及封面设计主题描述文本,本技能自动提取精确页面尺寸,用 AI 生成一张高清、无文字、符合封面主题的背景底图,并将底图作为真实背景层插入 PDF 底部——源 PDF 的书名、作者、条码等文字与图形始终保持为可选中的矢量内容(绝不栅格化、绝不合并为单张扁平位图)。支持横版/竖版/方形封面;人物默认中国面孔,主体严格限右半幅中下方、禁越中线,左侧留白承载标题;风格必须生动丰富有变化、禁单调。输出分层 PDF 与纯底图 PNG。触发词:图书封面、封面底图、衬底图、加底图、设计封面背景、design a cover background。"
agent_created: true图书封面设计 Skill(四段式流水线)
角色与流程总览
本技能把"给封面 PDF 加底图"拆成四个清晰岗位,前两段是提示词工程(由你——作为 LLM——完成),后两段是执行(调用脚本/绘图大模型):
- 布局提示词工程师 (Layout Prompt Engineer) — 分析用户 PDF 的布局结构(封底 / 书脊 / 封面分区、尺寸、是否有实底矩形遮挡、哪些区域密布深色文字),产出布局提示词(描述底图在各区域的明暗 / 留白 / 主题承载分配)。
- 绘图提示词工程师 (Drawing Prompt Engineer) — 把用户发来的主题文字(如"CO2封存,离岸,海洋碳汇,地质封存")扩展为绘图提示词(英文,描述主体 / 场景 / 风格 / 色调 / 氛围,不含文字)。
- 绘图设计师 (Drawing Designer) — 合并「布局提示词 + 绘图提示词 + NO TEXT 硬约束」,选定尺寸与方向,调用绘图大模型生成无文字底图。
- PDF衬底排版员 (PDF Background Compositor) — 去水印 → 精确裁剪到 PDF 尺寸 → 把底图作为真实背景层插入用户 PDF 底部。保存分层 PDF 与纯底图 PNG。
HARD RULES(贯穿全程,不可违反)
-
底图禁止写入任何文字(最高优先级 · 严格约束):禁用 ImageGen 生成、暗示或要求任何文字、字母、数字、符号、公式、标点字符。底图永远 100% 无文字;最终封面上的每个字都来自原 PDF 的矢量字形。合并提示词时首行
NO TEXT / NO LETTERS / NO NUMBERS / NO WORDS不可省略,且绘图提示词内绝不得出现可被模型误解为"请在图上写字"的措辞。 -
禁止栅格化合并 / alpha_composite 成单张扁平图。交付物是分层 PDF:源 PDF 文字/条码/图形作为可选中矢量在最上层,底图是下方图像层。条码/白块是源页上的图形,绝不重着色、绝不透明化。
-
底图永远衬于用户 PDF 底部;不修改、不替换源 PDF 的任何元素,只在其下加一层背景。
-
人物默认中国面孔(除非用户明确要外国特征);如涉及人物,在提示词写明 "with Chinese facial features"。
-
底图严禁纵向压扁/拉伸:生成时按用户 PDF 页面的真实宽高比出图,合成时整页矩形铺满(
preserveAspectRatio=False但图像与页面比例一致,无畸变);prepare_background.py仅做居中裁剪(宽或高单边裁切,绝不双向缩放),保证页面整页高度完整利用。 -
风格必须生动、丰富、有变化(严格约束 · 禁止单调):底图不得是单一平涂色块、寡淡的单色渐变或重复雷同的纹理。必须有具体的光影、明暗层次、材质质感与主题相关的具象视觉元素;画面要有呼吸感、焦点与视觉趣味。每次出图都应在构图、光影、色彩细节上体现多样性,避免千篇一律的"同一个模板换个颜色"。
-
绘图主体严格限制在右半幅中下方,禁止越过中线(严格约束):主体的全部视觉元素集中在页面右半部分(x ∈ 50%–100%)的中下区域(y 约 45%–88% 自顶,底部 ~12% 留为可裁空白);任何主体元素都不得越过垂直中线(x=50%)向左半部(封底区)延伸。左半部保持柔和、低对比、无焦点的留白,承载学报标题等深色文字。构图描述为"RIGHT HALF, middle-lower"——这是本刊封面固定版式,与"浑然一体整体背景"不矛盾:整体色调/光感统一贯通全页,但主题焦点只在右半幅,左半幅是柔化延伸的非焦点留白。
四段式详细流程
阶段 0:接收 PDF(准备)
把用户 PDF 存到工作区,运行布局提示词工程师的工具 analyze_layout.py 得到结构化的 layout brief:
<python_path> <skill_path>/scripts/analyze_layout.py <cover.pdf> [--max-chars 1500]
<python_path> = managed venv 解释器
(C:\Users\Administrator\.workbuddy\binaries\python\envs\default/Scripts/python.exe),
或任意装有 pypdf / PyMuPDF 的 Python。
<skill_path> = 本技能目录。
brief 含:page(宽高 pt / 方向 / 宽高比)、text_summary(整页深色文字面积与是否需整体浅色)、
barcode_qr_count、recommendation(合成参数建议)、text_sample(供理解主题)、hard_rules(硬规则清单)。
向用户回报:检测到的标题(用 text_sample 概括)、页面尺寸、方向,以及布局要点
(底图为浑然一体整体背景、是否需整体浅色保文字可读)。
若
text_sample为空或无法判断主题,询问用户书名与题材。
阶段 1:布局提示词工程师(产出「布局提示词」)
输入:analyze_layout.py 的 brief。
输出:一段英文「布局提示词」,描述底图是浑然一体的整体背景,铺满整页、不分区。
关键约定(用户明确要求):不分封底/封面、不考虑书脊、不画分界线、不考虑偏移量;
底图是一个统一视觉整体。依 brief 推导(详见 references/cover-prompt-guide.md「布局提示词模板」):
- 读
recommendation.layout_style,必须为seamless_unified→ 写 "ONE unified, seamless artwork covering the ENTIRE page. NO division into back-cover / front-cover zones, NO spine, NO divider line, NO offset." - 若
recommendation.keep_background_light == true→ 写 "OVERALL TONE: light & airy, low-contrast — all overlaid cover text (including dense small print on the back) must stay perfectly legible. Avoid large saturated or dark areas that would cover text." - 读
page.ratio_w_over_h→ 加入 "Preserve the page's exact aspect ratio (W/H = <ratio>); use the FULL page height, NO vertical compression / squashing." - 写主体位置(强制:右半幅中下,禁越中线),无论
recommendation.subject_placement取何值,本刊封面一律: "MAIN SUBJECT (the themed visual focus) is CONFINED to the RIGHT HALF of the page — strictly within x = 50% to 100% horizontally, and in the MIDDLE-LOWER vertical band (y ≈ 45% to 88% from top). The subject MUST NOT cross the vertical center line (x=50%) into the left / back-cover half under any circumstances; keep the LEFT HALF a soft, seamless, low-contrast, subject-free wash so the overlaid dark text (journal title, etc.) breathes. The subject stays soft and harmonious with the whole — not a hard-edged block, no divider. Additionally, the BOTTOM ~12% of the image must stay a soft seamless wash with NO subject, no horizon, no focal element — this band will be cropped off by the oversize+bottom-crop step in Stage 4 to remove the ImageGen watermark, so any detail there is wasted." - 中文面孔(若有人物)仍写 "with Chinese facial features"。
阶段 2:绘图提示词工程师(产出「绘图提示词」)
输入:用户发来的主题文字(如"CO2封存,离岸,海洋碳汇,地质封存"或"教师、幼儿园,真人")。 输出:一段英文「绘图提示词」,描述主体 / 场景 / 风格 / 色调 / 氛围(不含任何文字)。
规则(详见 references/cover-prompt-guide.md「绘图提示词扩展规则」):
- 把中文关键词扩展成具体可见的视觉元素(concrete over abstract)。例如 "CO2封存,离岸,地质封存" → "a realistic offshore CO2 storage scene: a small offshore platform on the horizon, real seawater, a clear waterline, pale subsea sediment/rock strata, and a soft white CO2 plume rising from an injection well."
- 风格必须生动、丰富、有变化(禁止单调 · 硬约束):底图不得是单色平涂或寡淡单调渐变。无论选写实摄影 / 水彩科学剖面 / 数字插画,都要写出明确的光影、层次、质感、色彩细节与构图焦点,让画面鲜活、有呼吸感、可信手看。每次出图都应主动在构图角度、光向、材质肌理、色彩微妙变化上做差异化,避免雷同模板。提示词里要明确点出风格词(如 "richly detailed", "lively", "with depth and atmospheric perspective", "varied textures"),并给出 2–3 个具象视觉焦点。
- 选择风格:写实摄影 / 水彩科学剖面 / 数字插画 … 依主题与期刊性质(真实场景需求→写实)。
- 色调与主题协调,并与阶段 1 的明暗约束一致(若
keep_background_light,整体保持浅色/低对比,确保全部文字可读)。 - 人物默认中国面孔;主体小、置于指定区域(右半幅中下,见 HARD RULE 7)。
阶段 3:绘图设计师(合并 + 调用绘图大模型)
把两段提示词合并为最终 ImageGen 提示词:
A book-cover background artwork, [ORIENTATION] orientation, designed to sit
BEHIND existing cover text. NO TEXT, NO LETTERS, NO NUMBERS, NO WORDS anywhere
in the image. (Strict: the image must be 100% text-free — do not render any
letters, digits, or characters.)
[布局提示词 — 来自阶段1:浑然一体的整体背景、整体明暗/留白、按页比例不纵向压缩、
主体严格限右半幅中下、底 12% 留白]
[绘图提示词 — 来自阶段2:主体/场景/风格/色调/氛围,风格须生动丰富有变化、禁单调]
[ORIENTATION]取brief.page.orientation(LANDSCAPE / PORTRAIT / SQUARE)。- 总长控制在 ~300 词内;首行
NO TEXT…不可省略(硬约束 1)。 - 合并时必须再次落实三条硬约束:① 全文 0 文字;② 风格生动丰富有变化(禁单调,HARD RULE 6);③ 主体全部落在右半幅中下、绝不越中线(HARD RULE 7)——不要因"浑然一体"而把主体铺满左半部。
size:LANDSCAPE→1536x1024,PORTRAIT→1024x1536,SQUARE→1024x1024。- 先告知用户:ImageGen 每次消耗约 5–10 积分。再调用:
ImageGen(prompt=<合并后的提示词>, size=<按方向>, quality="high",
output_dir=<工作区输出目录>)
ImageGen 会在底部约 15% 高度处盖「图片由AI生成」水印(实测水印顶约在 0.85 H,下面还有原图内容;无法用提示词抑制)。首选方案:阶段 4 的 oversize + 底裁机制直接裁掉(
--oversize 1.18),从根源避开修补,干净彻底,且不会在右下主体区留下光晕/残字。备用方案:remove-watermark.pyv7.1 仍保留供 fallback(当图像无法重做时使用;pass-0 锁盖戳区右 50%×底 28% +V≥218 AND S≤20取并集 bbox + Telea +block_repair兜底)。
阶段 4:PDF衬底排版员(oversize + 底裁 → 衬底)
核心思路:不去修补水印——直接把 ImageGen 原图按 PDF 高度的 110~120% 出图,构图上预留底部约 12% 空白,再在合成时把这块连带水印整条裁掉,输出恰好页面尺寸的干净底图。从根源避开 inpainting 的光晕/残字。
# 1) Oversize + 底裁(推荐)—— 直接用 raw ImageGen 图:
# 先 cover-fit 到 W × (H*oversize) 画布,再底裁 (oversize-1)*H,把"图片由AI生成"连同底部留白一并切掉。
# 输出就是恰好页面尺寸的纯底图。
<python_path> <skill_path>/scripts/prepare_background.py <RAW_imagegen.png> <cover-background.png> \
--width-pt <W> --height-pt <H> --dpi 300 --oversize 1.18
# --oversize 推荐 1.18 (18% 底裁):覆盖实测 ~15% 水印带 + 3% 安全余量,干净彻底。
# 严格按用户原始 10% 规格:--oversize 1.1 —— 但因水印实测顶在 0.85H,会留下约 23pt 字符顶部残条。
# 关闭该模式(恢复"按比例裁剪到页面尺寸"的旧行为):--oversize 1.0,此时需另用 remove-watermark.py。
# 2) 衬底(分层,矢量在上)—— 参数来自 brief.recommendation
<python_path> <skill_path>/scripts/composite_pdf.py <cover.pdf> <cover-background.png> <cover-layered.pdf> \
[--keep-fill] [--no-scrim | --scrim-alpha 0.55]
为什么不再默认先跑 remove-watermark.py:v7.1 的 inpainting 在浅色富纹理背景的右下主体区(风车、太阳能板、绿林常在这里)容易留下光晕和"图"字残影;oversize+底裁从几何上把水印连同底部一起切掉,零修补痕迹。
Fallback:若原图不是 ImageGen 产物、或者构图无法重做、且水印位置恰好不在底 10% 时,仍可:
<python_path> <skill_path>/scripts/remove-watermark.py <imagegen输出.png> <clean_artwork.png>
<python_path> <skill_path>/scripts/prepare_background.py <clean_artwork.png> <cover-background.png> \
--width-pt <W> --height-pt <H> --dpi 300
composite_pdf.py 的参数是由 brief 自动决定的,不要凭感觉:
brief.recommendation.keep_fill == true→ 加--keep-fill(源 PDF 无大块待剥离实底,或深色品牌块需保留)。brief.recommendation.strip_fill == true→ 不加--keep-fill(脚本会在矢量层删除该re…f实底,使底图透出)。brief.recommendation.scrim == "recreate"→ 用默认 scrim(同色半透明,保浅色标题可读);可微调--scrim-alpha 0.35~0.55。brief.recommendation.scrim == "off"→ 加--no-scrim。
保存 cover-layered.pdf(分层成品)与 cover-background.png(纯底图)。
校验(用 PyMuPDF 脚本或内联):
get_images()命中 → 背景是真实图层;- 原书名/作者/出版社/ISSN/定价 仍
get_text()可选取; - 条码白块原样保留。
阶段 5(可选):封面论文 / 专题 说明文字(可编辑矢量)
若用户在主题文本中写入 封面论文:<论文题目> 或 专题:<专题名>,
则在成品 PDF 的主体图上方、右边封面插入一行可编辑矢量文字,格式即
封面论文:<论文题目> / 专题:<专题名>。字体 小四号(12 pt)宋体(SimSun),
真实可选中、可编辑,绝非栅格化。
检测与写入由 add_caption.py 完成(自动识别触发、解析内容、定位、嵌字):
<python_path> <skill_path>/scripts/add_caption.py <cover-layered.pdf> <cover-layered-caption.pdf> \
--theme-text "<用户原始主题文本,含 封面论文:… 或 专题:…>"
# 或直接给文字:
<python_path> <skill_path>/scripts/add_caption.py <cover-layered.pdf> <cover-layered-caption.pdf> \
--caption "封面论文:纳米流体提高采收率机理研究"
- 位置默认:右边封面、居右对齐——文字底边位于距顶 0.59 H,右边缘距左 0.943 W
(x 0.661–0.943 W,y 顶 0.55 / 底 0.59 H);可用
--x0/--x1/--y-top/--y-bot/--align微调。该默认位置已据此用户多次微调后固化。 - ⚠️ PyMuPDF
insert_textbox把文字放在矩形框的【底部】,因此--y-bot才是文字 真正的纵向位置,--y-top只需明显小于--y-bot以留出框高(约 30 pt);框过矮会 导致文字被丢弃(务必get_text()校验已写入)。 - 若未检测到触发,
add_caption.py会原样复制 PDF(不报错),可安全总在阶段 4 后调用。 - 长标题自动换行(PyMuPDF
insert_textbox);最终交付cover-layered-caption.pdf。
最后用 present_files 交付成品(含说明文字的 PDF)与 cover-background.png,并向用户说明:
检测到的标题、尺寸、方向、DPI、是否保留实底 / 是否加 scrim,以及是否命中
封面论文/专题说明文字、所用字体字号。可提议 --scrim-alpha、--no-scrim、600 DPI、
重新生成底图,或调整说明文字位置。
命令速查(managed venv 解释器)
<python_path> = C:\Users\Administrator\.workbuddy\binaries\python\envs\default/Scripts/python.exe
<skill_path> = C:\Users\Administrator\.workbuddy\skills\editor-b-cover
# ① 布局分析(布局提示词工程师工具)
python <skill_path>/scripts/analyze_layout.py <cover.pdf> [--max-chars 1500]
# ② Oversize + 底裁(首选,直接处理 raw ImageGen 图,裁掉「图片由AI生成」水印)
python <skill_path>/scripts/prepare_background.py <RAW_imagegen.png> <cover-background.png> \
--width-pt <W> --height-pt <H> --dpi 300 --oversize 1.18
# ②b(备用,仅当无法用 oversize 时)去水印
python <skill_path>/scripts/remove-watermark.py <img.png> <clean.png>
# 然后用 --oversize 1.0 跑 prepare_background 即可
# ③ 衬底(分层,矢量在上)
python <skill_path>/scripts/composite_pdf.py <cover.pdf> <cover-background.png> <cover-layered.pdf> \
[--keep-fill] [--no-scrim] [--scrim-alpha 0.55] [--min-fill-frac 0.20]
# ⑤(可选)封面论文/专题 说明文字(可编辑矢量,小四宋体)
python <skill_path>/scripts/add_caption.py <cover-layered.pdf> <cover-layered-caption.pdf> \
--theme-text "<用户主题文本>" # 或 --caption "封面论文:…";微调 --x0/--x1/--y-top/--y-bot/--align
Technical Notes
- 页面尺寸 pt × (DPI/72) = 像素尺寸。300 DPI 的 6×9 in 封面 → 1800×2700 px;600 DPI → 3600×5400 px。
analyze_layout.py用 PyMuPDF 读出实底矩形、文字密度、条码位置,输出归一化(左上原点)区间,直接喂给提示词工程,避免"凭眼猜布局"。composite_pdf.py用pypdf的page.merge_page():背景页(图片 + 可选矢量 scrim)在下,源内容(含矢量剥离的实底)在上 → 文字/条码保持可选中矢量,底图是真实图像层。绝不用 PILalpha_composite把整页栅格化。prepare_background.py恒中心裁剪到目标比例(Lanczos),后续拉伸到页面零畸变。- 依赖(managed venv):
pypdf、reportlab、Pillow、opencv-python-headless、numpy、PyMuPDF(fitz)。
Resources
scripts/analyze_layout.py— 布局提示词工程师的工具:分析 PDF 布局,输出layout brief(JSON),含封底/书脊/封面分区、实底遮挡块、文字密度、条码位置与合成参数建议。scripts/extract_pdf.py— 备用:仅提取每页文字 + 尺寸(JSON)。scripts/prepare_background.py— 中心裁剪到精确页面比例 + 高 DPI 纯底图 PNG(交付物之一)。--oversize 1.1~1.2启用 oversize+底裁模式(首选,裁掉 ImageGen 水印);--oversize 1.0= 仅按比例裁剪(用于已用 inpainting 的图)。scripts/composite_pdf.py— 分层合成器:矢量剥离源实底(可选)、可选矢量 scrim、merge 源内容于背景之上,产出分层 PDF。scripts/remove-watermark.py— 备用/Fallback。Telea 修补去除 ImageGen "图片由AI生成"水印(v7.1,pass-0 锁盖戳区 + 并集 bbox + block_repair)。仅在无法用 oversize+底裁时使用;右下主体区易留光晕。scripts/add_caption.py— 识别封面论文:…/专题:…触发,在主体图上方右侧封面插入可编辑矢量说明文字(小四号宋体)。references/cover-prompt-guide.md— 布局提示词模板 + 绘图提示词扩展规则 + 风格/尺寸表。
Current listing version
1.0.3
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决图书/期刊封面设计中的高频刚需,为已有矢量 PDF 添加高质量 AI 底图并保持文字可选中
- 功能闭环完整,支持横版/竖版/方形封面,人物默认中国面孔,构图严格遵循出版规范
Highlights
- 触发词覆盖全面且边界清晰(图书封面、封面底图、衬底图、加底图、设计封面背景、design a cover background)
- 无歧义,能有效区分同类设计工具
Areas to improve
-
缺少 When to Use 显式章节 Reported severity: Minor
文档未设置独立的 'When to Use' 章节说明适用场景
Recommendation: 建议在 frontmatter 后增加 'When to Use' 章节,明确说明本技能适用于已有矢量 PDF 封面的底图添加场景
-
文档较长 Reported severity: Minor
主文档内容详尽但篇幅较长,可能影响快速查阅
Recommendation: 可考虑将部分技术细节移至附录或 references 目录,保持主流程简洁
Highlights
- 四段式流水线结构清晰(布局分析→提示词工程→绘图→衬底合成)
- 包含详细步骤、出口条件、端到端示例和命令速查表
Highlights
- 工具链完整且参数明确(analyze_layout.py, prepare_background.py, composite_pdf.py 等)
- 水印处理方案 robust(oversize+底裁为主,remove-watermark.py 为 fallback),避免 inpainting 光晕问题
- 分层 PDF 输出保证矢量文字可选中,符合出版要求
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Administrator or elevated privileges
Elevate only when necessary. Keep protection and certificate validation enabled and avoid broad system access.
Mentioned in main document · lines 43, 193, 194
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.