Fetch the cleanest product image from a router bit product page, save it, and pass it to the trim skill.
Given a product page URL and a target filename, find the best product image (clean, white/light background, bit clearly visible) and save it ready for trimming.
$ARGUMENTS should contain:
2703.jpg — it will be saved to workshop/public/bit-images/). Note: isolate-objects.py and trim-image.sh live in workshop/router-bits/.Fetch the product page using WebFetch. Ask it to extract ALL product image URLs from the page — every img src, data-src, data-zoom-image, or gallery/thumbnail URL that looks like a product photo. Exclude icons, logos, UI chrome, and SVGs.
Deduplicate the images. Product pages often serve the same image at multiple sizes via different cache paths or query strings. Group URLs by their base filename (the last path segment, ignoring cache/resize directories). Pick the largest version of each unique image. After downloading each candidate, check its actual pixel dimensions with — some cache paths serve thumbnails (e.g. 75x75) even though the URL looks similar. If a candidate is tiny, try alternate cache paths for the same filename to find the full-size version.
sips -g pixelWidth -g pixelHeightDownload all unique images to /tmp/bit-fetch-candidates/ (create the directory first, clearing any previous contents). Name them candidate-1.jpg, candidate-2.jpg, etc.
Visually inspect each candidate using the Read tool. Score each image on these criteria (best to worst):
Also prefer images where:
Select the best image. Copy it to workshop/public/bit-images/<output-filename>.
Invoke the trim-bit-image skill on the saved image:
/trim-bit-image workshop/public/bit-images/<output-filename>
Show the final result by reading the trimmed image so the user can verify it.