fotos-producto

Removes backgrounds, decontaminates edges, and crops product photos into alpha WebP catalog images.

Updated Jun 10, 2026
One-click install
npx skills add https://github.com/saulo-fl/armado-en-mexico --skill fotos-producto-saulo-fl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fotos-producto
Source: https://github.com/saulo-fl/armado-en-mexico/tree/main/.claude/skills/fotos-producto
Command: npx skills add https://github.com/saulo-fl/armado-en-mexico --skill fotos-producto-saulo-fl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rembg, pillow, numpy, and includes scripts (resource) components.

What problem does it solve? Product photos for the Armado en México catalog arrive as cutouts on opaque white backgrounds, which look broken on the site's dark gradient hero. This Skill automates the full image pipeline: background removal with alpha, edge decontamination, cropping, framing, and integration into the catalog data files for firearms, ammunition boxes, and accessories. ## Core Features & Use Cases - Background removal and edge cleanup: Uses rembg with the explicitly pinned birefnet-general model (avoiding the CC BY-NC default), decontaminates semi-transparent edges, crops to the subject, and encodes to WebP with alpha. - Automated quality control: Eleven mask and RGB metrics feed a red/amber/green semaphore, plus a generated HTML contact sheet for mandatory human review before approval. - Catalog integration: Approved images are copied into the site, cache-busting ?v= parameters are updated, and generated blocks in data.js, data-municiones.js, and data-accesorios.js are rewritten idempotently. - Use Case: When new ammunition enters the inventory, run the cajas.py cycle to find the manufacturer's box photo by brand+calibre key, process it, and apply it so every cartridge of that brand and calibre inherits the correct box image. ## Quick Start Ask the AI to prepare product photos for the pistol catalog entries and generate the contact sheet for review.

Frequently Asked Questions about fotos-producto

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove image backgrounds with rembg in Python?▼

Use rembg's remove() function with an explicit new_session('birefnet-general') to get an alpha mask, then take the RGB from the original image rather than rembg's output. Pinning the model matters because the default bria-rmbg model is CC BY-NC licensed.

How to fix white halo edges after background removal?▼

Apply color decontamination to the semi-transparent band using C_fg = (C_obs - (1-a)*C_bg) / a, correcting RGB instead of eroding the edge. Decontaminate before compressing, since compressing first fixes the white halo permanently into the WebP.

Does rembg work on GPU with RTX 50 series cards?▼

No, onnxruntime-gpu from PyPI lacks sm_120 kernels, so on Blackwell GPUs like the RTX 5070 the CUDA provider silently falls back to CPU. Expect roughly 20-40 seconds per photo on CPU inference.

Why should factory alpha channels sometimes be trusted over AI masks?▼

Manufacturer-published PNG cutouts are often human-made and better than inferred masks; re-inferring can fill details like trigger guard holes. However, some factory alphas contain dust clouds or text, so the pipeline validates frame transparency before trusting them.

What are the limitations of automated image quality metrics?▼

Metrics cannot detect wrong product variants, color tints, photos of the wrong subject, or boxes of a different calibre, all of which passed numeric checks in real batches. Human review of the generated contact sheet is mandatory before approval.