Knowledge > Runbooks > Content Ops > Add or Update Illustration Images
Add or Update Illustration Images
Source, optimize, and attach cover images to sermon illustrations on ITW. Images improve engagement and SEO on illustration detail pages.
Prerequisites
- Unsplash API access (
$UNSPLASH_ACCESS_KEYenv var) — for sourcing free-use images - Supabase Storage access (for image hosting)
- Image editing tool capable of resizing (ImageMagick, Sharp, or similar)
- Illustration IDs for the records to be updated
Image Specifications
| Property | Value |
|---|---|
| Format | JPEG (preferred) or WebP |
| Dimensions | 1200 × 675px (16:9 ratio) |
| File size | Under 300KB after optimization |
| Content | Thematic/abstract — avoid stock photo clichés |
| License | Unsplash license (free for commercial use) or explicitly licensed |
Steps
Source an Image from Unsplash
-
Search Unsplash for a relevant image using the API:
curl "https://api.unsplash.com/search/photos?query=[theme]&orientation=landscape&per_page=10" \-H "Authorization: Client-ID $UNSPLASH_ACCESS_KEY" \| jq '.results[] | {id: .id, description: .description, url: .urls.regular}'Replace
[theme]with a relevant keyword (e.g., "forgiveness light", "prayer mountain", "community church"). -
Download the selected image at the appropriate resolution:
curl "[image_url]?w=1200&h=675&fit=crop&q=85" -o illustration-[id].jpg -
Verify license compliance — Unsplash images are free for commercial use without attribution (recommended but not required). Document the Unsplash photo ID in case of dispute.
Optimize the Image
- Compress to under 300KB using ImageMagick or Sharp:
# Using ImageMagickconvert illustration-[id].jpg -resize 1200x675 -quality 82 illustration-[id]-opt.jpgls -lh illustration-[id]-opt.jpg # confirm file size
Upload to Supabase Storage
-
Upload the optimized image to the ITW illustrations storage bucket:
# Using Supabase CLI or direct API# The bucket is typically named 'illustrations' or 'itw-images'# Check the bucket name in the Supabase dashboard or via MCPVia Supabase MCP or the REST API:
POST /storage/v1/object/illustrations/[illustration-uuid].jpg -
Get the public URL of the uploaded image:
https://wrwkszmobuhvcfjipasi.supabase.co/storage/v1/object/public/illustrations/[illustration-uuid].jpg
Attach the Image to the Illustration
-
UPDATE the
unified_rag_contentrecord with the image URL:UPDATE unified_rag_contentSET image_url = 'https://wrwkszmobuhvcfjipasi.supabase.co/storage/v1/object/public/illustrations/[illustration-uuid].jpg',updated_at = now()WHERE id = '[illustration-uuid]'AND category = 'illustration'; -
Verify the image field is set:
SELECT id, title, image_url FROM unified_rag_content WHERE id = '[illustration-uuid]'; -
Confirm the image renders on ITW by visiting the illustration detail page:
https://illustratetheword.com/illustrations/[slug]
Batch Image Assignment
For adding images to many illustrations at once, use the image assignment script:
cd /c/dev/sermon-illustrations
unset CLAUDE_CODE_ENTRYPOINT
unset CLAUDECODE
node scripts/assign-images.js --topic "forgiveness" --limit 20
This script searches Unsplash, downloads, optimizes, uploads, and updates image_url in a single pass.
Verification
unified_rag_content.image_urlis populated for the target illustration.- Image loads correctly on the ITW illustration detail page.
- No 404 errors for the image URL.
- Image dimensions and file size meet specifications.
See Also
- add-illustrations.md — add the illustration content first
- audit-content.md — identify illustrations missing images at scale