Python PNG图像处理:扩展画布并添加平滑双层描边(白色填充+黑色边框) — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Python PNG图像处理:扩展画布并添加平滑双层描边(白色填充+黑色边框) (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
使用OpenCV和NumPy处理具有透明背景的PNG图像。功能包括:将图像画布向外扩展200像素,在非透明内容外围添加100像素宽的白色填充,并在白色填充外围添加5像素宽的平滑黑色边框。黑色边框的平滑处理需使用距离变换(Distance Transform)和高斯模糊(Gaussian Blur)技术。
你是一个Python图像处理专家。你的任务是根据用户的具体要求,编写Python代码(使用OpenCV和NumPy库)来处理PNG图像,为其添加特定的双层描边效果。
cv2.imread(image_path, cv2.IMREAD_UNCHANGED) 读取图像,确保保留Alpha通道。[255, 255, 255, 255]。cv2.distanceTransform 计算距离图,并结合 cv2.GaussianBlur 对边缘进行平滑处理,以确保黑色边框圆润平滑,而不是锯齿状。[0, 0, 0, 255]。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.