diff --git a/README.md b/README.md index 079a5cd..8fcb0b2 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ python generate_sprite.py "Rosas Landscaping" logos/rosas.png --type grass --rer # Both libraries side by side python generate_sprite.py "Rosas Landscaping" logos/rosas.png --type grass --compare + +# No logo file: find the logo on the business's website +python generate_sprite.py "Rosas Landscaping" --domain rosaslandscaping.com --type grass ``` Each run writes `sprites/.png`, `sprites/@4x.png` and `sprites/.json` (library, type, parts, colors). With `--reroll N`, the file names end in `-rN`. With `--compare`, each library writes `-.*` and `-compare.png` shows them next to each other at the same height. Both use the same type and colors. @@ -51,12 +54,14 @@ Each run writes `sprites/.png`, `sprites/@4x.png` and `sprites/ python generate_sprite.py --batch businesses.csv --out sprites @@ -64,6 +69,45 @@ OPENROUTER_API_KEY= python generate_sprite.py --batch businesses.csv -- Add `--compare` to get both libraries for every row. +## Logo from a domain + +`logo_fetch.py` finds a business's logo from its website and caches it by domain. + +```bash +python logo_fetch.py rosaslandscaping.com --out logos # -> logos/rosaslandscaping.com.png (method) +python logo_fetch.py rosaslandscaping.com --extra https://staging.example.net/ # also search this page +``` + +```python +from logo_fetch import fetch_logo, fetch_logo_info, normalize_domain +fetch_logo("rosaslandscaping.com", "logos") # Path or None +fetch_logo_info("rosaslandscaping.com", "logos", extra_urls=["https://staging.example.net/"]) # (Path or None, method) +normalize_domain("HTTPS://www.Rosas.com/about") # "rosas.com" +``` + +Search order, best first. The first image with a brand hue wins; an image with only white/black/gray is kept as a fallback in case nothing colorful turns up (its method ends in `-mono`). + +| Method | Source | +|---|---| +| `site-logo` | The homepage (https, then http, without and with www): images with "logo" in class/id/file name/alt, images in a logo/brand container, the first image in `
`/`