Image Search with Dual-Mode Operation
This skill provides intelligent image search and extraction using Jina AI's APIs with two distinct modes of operation:
- AI Selection Mode - Claude automatically finds and selects the best image(s) based on criteria
- Human Browsing Mode - Claude finds multiple images and presents them for user selection
When to Use This Skill
Use this skill for:
- Finding images of specific subjects, objects, or concepts
- Locating app screenshots (e.g., "MyFitnessPal screenshot")
- Searching for stock photos or illustrations
- Extracting images from specific websites
- Getting visual references for projects
Operating Modes
Mode 1: AI Selection (Default)
When to use: User wants a specific image and trusts you to find the best match.
Trigger phrases:
- "Find me an image of X"
- "Get me a screenshot of Y app"
- "I need a photo of Z that is [specific criteria]"
- "Find a red windmill image" (note the specific requirement)
Workflow:
- Search for relevant URLs
- Scrape multiple URLs concurrently to get many candidate images
- Analyze all found images against user criteria
- Select and return the best match(es)
- Explain why you selected it
Mode 2: Human Browsing
When to use: User wants to see options and make their own choice.
Trigger phrases:
- "Browse X images for me"
- "Show me 20 sunset photos"
- "Let me choose from windmill images"
- "Find some options for Y"
Workflow:
- Search for relevant URLs
- Scrape multiple URLs concurrently to get many candidate images
- Present all found images with descriptions
- Let user select their preference
Core Scripts
1. jina_search.py - Find URLs
Searches for pages containing relevant images:
python scripts/jina_search.py "<search query>" [max_results]
Examples:
# Search for app screenshots
python scripts/jina_search.py "MyFitnessPal app screenshot" 5
# Search without platform specificity (Jina finds relevant sources)
python scripts/jina_search.py "red windmill photo" 5
# Search for stock photos
python scripts/jina_search.py "unsplash sunset beach" 3
Returns JSON with URLs to pages that likely contain images.
2. jina_scrape.py - Extract from Single URL
Scrapes one URL to extract images in markdown format:
python scripts/jina_scrape.py "<url>"
Example:
python scripts/jina_scrape.py "https://play.google.com/store/apps/details?id=com.myfitnesspal.android"
Returns markdown with embedded image URLs.
3. jina_batch_scrape.py - Extract from Multiple URLs (RECOMMENDED)
Scrapes multiple URLs concurrently for faster results:
# Direct URLs
python scripts/jina_batch_scrape.py "<url1>" "<url2>" "<url3>"
# From search results
python scripts/jina_batch_scrape.py --from-search-json '<search_json>'
Example workflow:
# Step 1: Search
SEARCH_RESULTS=$(python scripts/jina_search.py "MyFitnessPal screenshot" 5)
# Step 2: Batch scrape all found URLs
python scripts/jina_batch_scrape.py --from-search-json "$SEARCH_RESULTS"
Returns JSON with all extracted images from all sources, ready for AI analysis or human viewing.
Recommended Workflows
AI Selection Mode Workflow
When user says "Find me an image of a red windmill":
Search for sources:
python scripts/jina_search.py "red windmill" 5Batch scrape all URLs concurrently:
python scripts/jina_batch_scrape.py --from-search-json "$SEARCH_RESULTS"Analyze the JSON output - Look at all images from all sources
Select best match based on:
- Relevance to query (is it actually a windmill?)
- Specific criteria (is it red?)
- Image quality (resolution, clarity)
- Context (is it the main subject or background?)
Return the selected image URL with explanation
Human Browsing Mode Workflow
When user says "Show me 20 windmill photos to choose from":
Search for sources (request more results):
python scripts/jina_search.py "windmill photos" 10Batch scrape to get many images:
python scripts/jina_batch_scrape.py --from-search-json "$SEARCH_RESULTS"Present images to user - Show URLs with descriptions from alt text
Let user choose their preferred image(s)
Search Strategy
Generic Searches (Recommended)
Jina AI search works like Google - you don't need to specify platforms:
# Good: Let Jina find the best sources
python scripts/jina_search.py "coffee shop interior" 5
python scripts/jina_search.py "iPhone app screenshot calculator" 5
Platform-Specific Searches (Optional)
You can still target specific platforms if desired:
# Target stock photo sites
python scripts/jina_search.py "unsplash mountain landscape" 3
python scripts/jina_search.py "pexels workspace desk" 3
# Target app stores for screenshots
python scripts/jina_search.py "play store MyFitnessPal" 3
App Screenshots
For app screenshots, Jina automatically finds relevant sources like Google Play, App Store, review sites:
python scripts/jina_search.py "MyFitnessPal app screenshot" 5
python scripts/jina_search.py "Spotify mobile app interface" 5
Concurrent Operation Benefits
Using jina_batch_scrape.py for concurrent scraping provides:
- Speed - Scrapes 5-10 URLs in the time it takes to scrape 1
- More options - Get 20-50+ candidate images at once
- Better selection - Compare images from multiple sources
- Human-like workflow - Mimics browsing Google Images where you see many results
AI Selection Guidelines
When operating in AI Selection Mode, evaluate images based on:
1. Relevance
- Does the image match the subject requested?
- Is the subject the main focus or just background?
2. Specific Criteria
- If user mentioned color, verify it matches
- If user wants "screenshot", ensure it's actually an app/website screenshot
- If user wants "professional", prioritize high-quality stock photos
3. Technical Quality
- Prefer larger images (check URL parameters like w526, w600, etc.)
- Avoid tiny icons (s20, s32, s48, s64)
- Look for screenshot indicators (w526-h296 common for app screenshots)
4. Context
- Consider the source (app store = authentic screenshots, stock sites = staged photos)
- Read alt text for additional context
Common Patterns
Pattern 1: Finding Specific App Screenshot
# User: "Find me a MyFitnessPal screenshot showing the food logging screen"
# Step 1: Search
RESULTS=$(python scripts/jina_search.py "MyFitnessPal screenshot food logging" 5)
# Step 2: Batch scrape
IMAGES=$(python scripts/jina_batch_scrape.py --from-search-json "$RESULTS")
# Step 3: Analyze JSON, find screenshots showing food logging interface
# Step 4: Return best match with explanation
Pattern 2: Browsing Stock Photos
# User: "Show me 15 sunset beach photos to choose from"
# Step 1: Search with more results
RESULTS=$(python scripts/jina_search.py "sunset beach photos" 10)
# Step 2: Batch scrape all
IMAGES=$(python scripts/jina_batch_scrape.py --from-search-json "$RESULTS")
# Step 3: Present all found images to user (likely 30-50+ images total)
Pattern 3: Specific Criteria Match
# User: "Find me an image of a red bicycle, make sure it's actually red"
# Step 1: Search broadly
RESULTS=$(python scripts/jina_search.py "red bicycle" 5)
# Step 2: Get many options
IMAGES=$(python scripts/jina_batch_scrape.py --from-search-json "$RESULTS")
# Step 3: Can't verify color from URL alone - get multiple candidates and
# explain that color verification requires viewing the images
Important Notes
- API Key: Scripts use hardcoded Jina AI API key
- Concurrency: Batch scraping uses 5 concurrent workers by default
- Filtering: Automatically filters out small icons (<64px), focuses on content images
- Output Format: All scripts output UTF-8 JSON for easy parsing
- Rate Limiting: Respect API rate limits; concurrent requests are throttled
- Image Rights: Remind users to check licensing for commercial use
Advanced: Direct URL Scraping
If user provides a specific URL, skip search and scrape directly:
python scripts/jina_scrape.py "https://example.com/page"
Troubleshooting
No images found:
- Try broader search terms
- Check if the website blocks scraping
- Try different sources (add "stock photo" or "wallpaper" to query)
Poor quality matches:
- Increase search results:
jina_search.py "query" 10 - Try platform-specific searches: add "unsplash" or "pexels"
- Search for app store URLs explicitly: add "play store" or "app store"
Wrong type of image:
- Be more specific in search query
- Add qualifiers like "screenshot", "photo", "illustration"
- Use AI Selection mode with explicit criteria in your prompt
Reference
For detailed source recommendations and strategies, see references/image_sources.md.