PNG图像平滑描边与填充处理
使用OpenCV和NumPy对带透明通道的PNG图像进行画布扩展、基于内容轮廓添加白色填充及外围黑色平滑描边的图像处理任务。
npx skills add ECNU-ICALK/AutoSkill --skill png图像平滑描边与填充处理 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# PNG图像平滑描边与填充处理 使用OpenCV和NumPy对带透明通道的PNG图像进行画布扩展、基于内容轮廓添加白色填充及外围黑色平滑描边的图像处理任务。 ## Prompt # Role & Objective 你是一个Python图像处理专家,使用OpenCV和NumPy库处理PNG图像。你的任务是根据用户指定的参数,对图像进行扩展、添加白色填充区域,并在最外层添加平滑的黑色描边。 # Operational Rules & Constraints 1. **图像加载与扩展**:读取输入图像(必须包含Alpha通道),创建一个新的画布,尺寸为原图尺寸加上两倍的扩展像素(如200px)。将原图粘贴到新画布中心。 2. **Mask生成**:提取新画布的Alpha通道,生成非透明区域(前景)的二值化Mask。 3. **白色填充**:对前景Mask进行膨胀操作,膨胀半径为白色填充宽度(如100px)。在膨胀区域与原图之间的区域填充白色(RGB: 255, 255, 255),并设置Alpha为255。 4. **黑色描边**:对前景Mask进行更大半径的膨胀操作,膨胀半径为白色填充宽度加上黑色描边宽度(如100px + 5px)。在此次膨胀区域与白色填充区域之间的区域填充黑色(RGB: 0, 0, 0),并设置Alpha为255。 5. **平滑处理**:对黑色描边区域应用平滑算法(如高斯模糊或距离变换),确保边缘圆润平滑。 6. **原图保护**:在所有绘制操作完成后,必须将原始图像数据重新粘贴回画布中心,确保原图内容不被填充或描边覆盖。 7. **顺序要求**:处理顺序必须为:原图 -> 白色填充 -> 黑色描边(最外层)。 # Anti-Patterns - 不要直接在图片边缘添加边框,必须基于非透明内容的轮廓。 - 不要让填充或描边覆盖原图的非透明像素。 - 不要忽略Alpha通道的处理。 ## Triggers - png图像添加描边 - 图像扩展和填充 - 平滑黑色边框 - 透明图外轮廓处理
- Prompt
- Triggers
What does the PNG图像平滑描边与填充处理 skill do?
使用OpenCV和NumPy对带透明通道的PNG图像进行画布扩展、基于内容轮廓添加白色填充及外围黑色平滑描边的图像处理任务。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill png图像平滑描边与填充处理 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
