The process-artworks.sh script generates optimized images for the artwork gallery from high-resolution source images.
Source files: docs/HIGHRES-IMAGES/1200p_{B1-B8,W1-W8}.{jpg,png}
Output files: assets/artworks/{slug}/{thumbnail.png,print.png}
# Preview the mapping and operations (no files created)
./scripts/process-artworks.sh --dry-run
# Process all artwork images
./scripts/process-artworks.sh
# Reprocess existing outputs (overwrite)
./scripts/process-artworks.sh --force
-resize 800x800 -gravity center -background white -extent 800x800-resize 1800x1800>All 16 artworks are mapped in the script:
IGNEOUS Series (B1-B8):
2026-03-01-fractured-system2026-03-02-void-emergence2026-03-03-debris-field2026-03-04-layered-collapse2026-03-05-scattered-archipelago2026-03-06-saturated-network2026-03-07-fossilized-echo2026-03-08-compressed-timeEROSION Series (W1-W8):
2026-03-09-last-coordinate2026-03-10-grid-zero2026-03-11-horizon-dissolution2026-03-12-inverted-territory2026-03-13-organic-terrain2026-03-14-primal-chaos2026-03-15-containment-lines2026-03-16-fading-linesconvert, identify commands)⚠️ Important: ImageMagick has hardcoded resource limits in its policy file that cannot be overridden via command-line flags. Large images may fail with “cache resources exhausted” error.
convert -list resource
Look for:
Memory: (should be ≥ 2GB)Map: (should be ≥ 2GB)Disk: (should be ≥ 2GB)Area: (should be ≥ 4GB megapixels)If you get “cache resources exhausted” errors, increase the limits in the ImageMagick policy file:
sudo nano /etc/ImageMagick-6/policy.xml
Find these lines and update them:
<policy domain="resource" name="memory" value="4GiB"/>
<policy domain="resource" name="map" value="4GiB"/>
<policy domain="resource" name="disk" value="4GiB"/>
<policy domain="resource" name="area" value="4GP"/>
Or use sed to update automatically:
sudo sed -i 's/name="memory" value="[^"]*"/name="memory" value="4GiB"/' /etc/ImageMagick-6/policy.xml
sudo sed -i 's/name="map" value="[^"]*"/name="map" value="4GiB"/' /etc/ImageMagick-6/policy.xml
sudo sed -i 's/name="disk" value="[^"]*"/name="disk" value="4GiB"/' /etc/ImageMagick-6/policy.xml
sudo sed -i 's/name="area" value="[^"]*"/name="area" value="4GP"/' /etc/ImageMagick-6/policy.xml
Then try the script again:
./scripts/process-artworks.sh
After processing:
# Check that all thumbnails exist and are 800x800
identify -format "%f: %wx%h\n" assets/artworks/*/thumbnail.png
# Check that all print images exist and are correctly sized
identify -format "%f: %wx%h\n" assets/artworks/*/print.png
# Verify in browser
bundle exec jekyll serve
# Visit http://localhost:4000/gallery/ to see the gallery grid
--dry-run: Preview the mapping and commands without creating files--force: Reprocess and overwrite existing output files (default: skip if exists)Exit codes:
0: All images processed successfully (or already exist)1: Error encountered (missing source, ImageMagick issue, or processing failure)scripts/process-artworks.shdocs/HIGHRES-IMAGES/1200p_*.{jpg,png}assets/artworks/{slug}/ (16 directories, one per artwork)--dry-runTo extend the script for new artwork series, follow these steps:
Requirements:
Naming Convention:
Place source files in docs/HIGHRES-IMAGES/ with the pattern: 1200p_{KEY}.(jpg|png)
Examples:
1200p_B1.jpg (first image in B series)1200p_W5.png (fifth image in W series)Keys are typically 2-character identifiers (letter + number, e.g., B1-B8, W1-W8 for an 8-work series).
Edit scripts/process-artworks.sh and add your key → slug mapping to the MAPPING table (lines 63-80):
declare -A MAPPING=(
# Existing entries...
[B1]="2026-03-01-fractured-system"
# Add your new entries:
[Z1]="2026-04-01-new-work-title"
[Z2]="2026-04-02-another-work-title"
# ... more new entries
)
Slug naming convention:
YYYY-MM-DD-{work-slug}new-work-title)Create _artworks/YYYY-MM-DD-{slug}.md files for each artwork with:
Required Front Matter:
published: truetitle: "Work Title"image: /assets/artworks/YYYY-MM-DD-slug/thumbnail.png (references the generated thumbnail)abstract: "Brief description"description: | (full description with markdown support)Recommended Fields:
series: "Series Name"year: "2026"medium: "Medium description"dimensions: "H × W × D cm"Sections:
Use the split-hero-metadata module to display the high-res print image:
sections:
- type: description # Displays the description field
- type: split-hero-metadata
content_type: "image"
image: /assets/artworks/YYYY-MM-DD-slug/print.png # References generated print image
caption: "Optional caption"
custom:
- label: "Series"
value: "Series Name"
- label: "Medium"
value: "Ink on paper"
- label: "Dimensions"
value: "29.7 × 42 × 0.1 cm"
- label: "Year"
value: "2026"
- label: "Status"
value: "Available"
See _artworks/2026-03-01-fractured-system.md for a complete example.
Create assets/artworks/{slug}/ directories (one per artwork). These will hold the generated thumbnail.png and print.png files:
mkdir -p assets/artworks/2026-04-01-new-work-title
mkdir -p assets/artworks/2026-04-02-another-work-title
Process all artworks in the updated mapping:
# Preview without creating files
./scripts/process-artworks.sh --dry-run
# Process all artworks
./scripts/process-artworks.sh
# Reprocess and overwrite existing images
./scripts/process-artworks.sh --force
The script will:
assets/artworks/{slug}/Check that all images were generated with correct dimensions:
# List all thumbnails with dimensions
identify -format "%f: %wx%h\n" assets/artworks/*/thumbnail.png
# List all print images with dimensions
identify -format "%f: %wx%h\n" assets/artworks/*/print.png
# Expected results:
# thumbnail.png: 800x800
# print.png: depends on source aspect ratio, max 1800px longest side
“cache resources exhausted” error: ImageMagick has hardcoded resource limits in its policy file. If processing fails, increase the limits:
sudo nano /etc/ImageMagick-6/policy.xml
Update these values to 4GB (or higher if available):
<policy domain="resource" name="memory" value="4GiB"/>
<policy domain="resource" name="map" value="4GiB"/>
<policy domain="resource" name="disk" value="4GiB"/>
<policy domain="resource" name="area" value="4GP"/>
Or use the automatic sed commands in the script’s comments (lines 102-109).
This same workflow can be used for:
Just add mapping entries, create markdown files, prepare source images, and run the script.