关于 gemini-logo-remover
gemini-logo-remover 是用于移除 AI 生成图像中 Gemini 标志和水印的 Python 技能,通过图像修补填补指定区域。适合需要处理图像角落标记的用户。
主要功能
- 01按坐标修补矩形区域
- 02按图像角落移除标志
- 03可调整区域尺寸与边距
- 04将结果保存到指定输出目录
适用场景
- 01移除图像右下角的 Gemini 标志
- 02修补背景较均匀的小块区域
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ bear2u/ my-skills --skill gemini-logo-remover安装后在 Claude Code 中输入/gemini-logo-remover确认已加载。
详细介绍
Gemini 标志移除工具
使用修复功能移除 AI 生成图片中的 Gemini 标志和水印。
设置
pip install opencv-python numpy pillow --break-system-packages
用法
按坐标
import cv2
import numpy as np
def remove_region(input_path, output_path, x1, y1, x2, y2, radius=5):
"""Remove rectangular region using inpainting."""
img = cv2.imread(input_path)
h, w = img.shape[:2]
mask = np.zeros((h, w), dtype=np.uint8)
cv2.rectangle(mask, (x1, y1), (x2, y2), 255, -1)
result = cv2.inpaint(img, mask, radius, cv2.INPAINT_TELEA)
cv2.imwrite(output_path, result)
# Example: remove region at coordinates
remove_region('/mnt/user-data/uploads/img.png',
'/mnt/user-data/outputs/clean.png',
x1=700, y1=650, x2=800, y2=720)
按角落
def remove_corner_logo(input_path, output_path, corner='bottom_right',
w_ratio=0.1, h_ratio=0.1, padding=10):
"""Remove logo from corner. corner: top_left, top_right, bottom_left, bottom_right"""
img = cv2.imread(input_path)
h, w = img.shape[:2]
lw, lh = int(w * w_ratio), int(h * h_ratio)
coords = {
'bottom_right': (w - lw - padding, h - lh - padding, w - padding, h - padding),
'bottom_left': (padding, h - lh - padding, lw + padding, h - padding),
'top_right': (w - lw - padding, padding, w - padding, lh + padding),
'top_left': (padding, padding, lw + padding, lh + padding)
}
x1, y1, x2, y2 = coords[corner]
mask = np.zeros((h, w), dtype=np.uint8)
cv2.rectangle(mask, (x1, y1), (x2, y2), 255, -1)
result = cv2.inpaint(img, mask, 5, cv2.INPAINT_TELEA)
cv2.imwrite(output_path, result)
# Example: remove bottom-right logo
remove_corner_logo('/mnt/user-data/uploads/img.png',
'/mnt/user-data/outputs/no_logo.png',
corner='bottom_right', w_ratio=0.08, h_ratio=0.08)
查找坐标
img = cv2.imread(input_path)
h, w = img.shape[:2]
print(f"Size: {w}x{h}")
# Gemini 별 로고는 보통 이미지 우하단 모서리에서 약간 안쪽에 위치
# 일반적인 좌표: x1=w-150, y1=h-100, x2=w-130, y2=h-55
# 정확한 위치는 이미지마다 다르므로 조정 필요
输出
始终保存到 /mnt/user-data/outputs/,并使用 present_files 工具。
注意事项
- 修复功能最适用于背景均匀的小区域
- Gemini 标志通常位于右下角
- 根据标志的实际位置和大小调整坐标/比例
评论
支持 Markdown