| name | photo-rebrand |
| description | Use ONLY when a user needs to remove a competitor's watermark from a listing photo in a LEGITIMATE co-broker or authorized-resale arrangement (industry-standard practice in used equipment dealing where Broker A has the seller and Broker B has the buyer, photos shared between brokers as normal operations). Removes pixel-baked watermarks via OpenCV inpainting (Telea/NS algorithms), expanded region masking, and morphological refinement. REQUIRES explicit user confirmation of the co-broker basis before any modification. Every operation writes an audit log entry to .rebrand_log.jsonl with timestamp, photo hash, basis, and co-broker contact for paper-trail purposes. Best results when chained with photo-watermark to apply the user's own brand over the cleaned region. Triggers on phrases like "rebrand this listing photo", "remove the watermark", "co-broker rebrand", "swap the watermark", "this is a shared listing", or any photo with a visible competitor watermark in an authorized resale context. |
Photo Rebrand (Co-Broker Edition)
Removes pixel-baked watermarks from listing photos in legitimate co-brokerage arrangements. Requires explicit user confirmation of authorization before any modification. Every operation is logged for audit purposes.
When this fires
- "Rebrand this listing photo"
- "Remove the watermark — this is a co-broker deal"
- "Swap the watermark on this photo"
- "I'm sharing this listing with [other broker], rebrand it"
- After the inspector flags a watermark and the user says "yes, that's authorized — remove it"
CRITICAL: confirmation flow
This skill modifies pixel-level branding that has legal weight. Before any rebrand:
Step 1 — Explain what's happening
"This will remove the [Machinery Network / source] watermark from the photo. Watermarks can carry legal weight (copyright notices, trademark claims), so I need to confirm this is an authorized rebrand before proceeding."
Step 2 — Get explicit confirmation of basis
Ask the user to confirm ONE of these bases for the rebrand:
Please confirm the basis for this rebrand:
☐ Co-broker arrangement — The original broker (named: ____) and I are co-listing this machine. Photos shared as part of the co-broker agreement.
☐ Authorized resale — I have explicit permission from the original photo owner to re-list this photo under my brand.
☐ Stock OEM photo — This was an OEM brochure photo that got watermarked downstream; the OEM grants downstream reseller use.
☐ Other (please specify): _______________
I also need the contact/name of the co-broker (for the audit log): _______________
Step 3 — Acknowledge and proceed
Only after the user provides:
- The basis (one of the checkboxes)
- The co-broker name (if applicable)
…call rebrand_photo() with confirmed=True.
Step 4 — Display the log entry
After rebrand, show the user the audit entry that was written:
✓ Rebrand complete.
Timestamp: 2026-05-28 02:15:43
Source: ynnjkrazj0jevf413gosylm8b4le.webp
SHA256: 3f8a1c... (truncated)
Basis: Co-broker arrangement
Co-broker: Machinery Network
Region: bottom-right
Output: /mnt/user-data/outputs/photo_rebranded.jpg
Log location: /mnt/user-data/uploads/.rebrand_log.jsonl
The technical flow
import sys
sys.path.insert(0, 'scripts')
from rebrand import rebrand_photo
entry = rebrand_photo(
input_path="/mnt/user-data/uploads/photo.jpg",
output_path="/mnt/user-data/outputs/photo_rebranded.jpg",
region=(y0, y1, x0, x1),
region_label="bottom-right",
region_padding=0.5,
basis="Co-broker arrangement",
co_broker="Machinery Network",
mask_mode="auto",
inpaint_radius=5,
inpaint_method="telea",
dilate_px=6,
confirmed=True,
)
Quality expectations — be honest with the user
OpenCV inpainting is good but not perfect on real-world watermarks. Set expectations:
| Watermark style | Background | Quality |
|---|
| Solid logo over plain area (sky, blank wall) | Plain | Excellent — invisible removal |
| Solid logo over busy content | Mixed | Good — minor blur in cleaned area |
| Translucent text over busy content | Hard | Visible smudge — needs cover |
| Tiled / full-image watermarks | N/A | Not removable with this tool |
Standard practice: chain rebrand with photo-watermark to apply the user's own logo over the cleaned region. The user's logo hides any inpaint imperfection, and the end-state is what they wanted anyway — their brand on the listing photo.
from watermark import apply_watermark
apply_watermark(
input_path="/mnt/user-data/outputs/photo_rebranded.jpg",
output_path="/mnt/user-data/outputs/photo_final.jpg",
position="bottom-right",
opacity=0.75,
scale=0.22,
use_brand_cache=True,
)
Audit log
Every rebrand writes a JSON line to .rebrand_log.jsonl:
{
"timestamp": "2026-05-28T02:15:43.123456",
"operation": "watermark_removal",
"source_photo": "/mnt/user-data/uploads/listing.webp",
"source_sha256": "3f8a1c4e...",
"output_photo": "/mnt/user-data/outputs/listing_rebranded.jpg",
"basis": "Co-broker arrangement",
"co_broker": "Machinery Network",
"region": "bottom-right",
"inpaint_radius_px": 5
}
The SHA-256 of the source file ties the log entry to the EXACT input photo — useful if anyone ever questions the basis. Same photo + different basis = two log lines, both recoverable.
Anti-patterns
- ❌ Removing a watermark without user confirmation. Always require the explicit confirmation step.
- ❌ Removing watermarks from photos with no claimed authorization. The skill is for co-broker / authorized cases only. If the user can't name a basis, decline.
- ❌ Removing without logging. Every operation gets a log entry, no exceptions.
- ❌ Promising perfect removal. Inpainting has visible artifacts on complex backgrounds. Tell the user up-front, plan to cover with their own watermark.
- ❌ Bypassing the confirmation by passing confirmed=True without asking. The flag exists to enforce the conversation, not to skip it.
Companion skills
- photo-metadata-inspector — runs FIRST to detect the watermark region and provide the slice coordinates this skill needs
- photo-watermark — runs AFTER to apply the user's own brand over the cleaned area
The natural three-skill chain: inspect → rebrand → watermark.
File map
scripts/rebrand.py — inpainting engine + audit logger
references/legal_context.md — explains the legitimate co-broker basis for educational purposes