This guide helps you optimize images for the Amaranth website to improve loading times.
Large image files (5-6MB) significantly slow down page loading. Optimized images:
macOS:
brew install imagemagick
macOS 12 (Monterey) - If you encounter libraw checksum errors:
# Install ImageMagick from pre-built binary instead
curl -O https://imagemagick.org/archive/binaries/ImageMagick-arm64-apple-darwin20.1.0.tar.gz
sudo tar xzf ImageMagick-arm64-apple-darwin20.1.0.tar.gz -C /opt/
export PATH="/opt/ImageMagick-7.1.1/bin:$PATH"
# Add to ~/.bash_profile or ~/.zshrc to make permanent
Windows:
Verify installation:
convert --version
From the project root directory, always preview changes first:
bash scripts/optimize-images.sh --preview
This shows what would be optimized without modifying any files. Review the output to ensure the estimated savings look reasonable.
Once you’re confident about the changes:
bash scripts/optimize-images.sh
The script will:
assets/images/headers/ - Page headers/hero images (2000px max width)assets/images/events/ - Event images (1600px max width)assets/images/posters/ - Poster images (1600px max width)assets/images/projects/ - Project images (1600px max width)assets/images/services/ - Service images (1600px max width)assets/images/site/ - Site assets (1600px max width)assets/images/team/ - Team photos (1200px max width)--folder: headers, events, posters, projects, services, site, teamReview the output summary showing how much space was saved. The script displays:
bundle exec jekyll serve
Visit http://localhost:4000 and verify all images display correctly. Optimize quality if needed (see troubleshooting).
Your originals are safely backed up in assets/images/backup-TIMESTAMP/. You can:
rm -rf assets/images/backup-*| Image Type | Max Width | Quality | Use Case |
|---|---|---|---|
| Headers | 2000px | 85% | Page headers / hero images |
| Events/Posters/Projects/Services/Site | 1600px | 85% | General content, hero assets |
| Team | 1200px | 85% | Team member portraits |
Check image dimensions:
identify -format "%wx%h %f\n" *.png
Check file sizes:
du -sh assets/images/*/*.{png,jpg}
Manually resize a single image:
convert input.png -resize '1200x>' -quality 85 output.png
“convert: command not found”
I want to test the script without modifying files
./scripts/optimize-images.sh --previewImages look blurry after optimization
cp -r assets/images/backup-TIMESTAMP/* assets/images/./scripts/optimize-images.sh --quality 90Script skipped my images
cp assets/images/backup-TIMESTAMP/[folder]/*.png assets/images/[folder]/I need to restore original images
cp -r assets/images/backup-TIMESTAMP/* assets/images/Script fails on Windows
./scripts/optimize-images.sh --preview first./scripts/optimize-images.sh to actually optimizegit ls-files assets/images/ | while read f; do grep -rq "$(basename $f)" . || echo "Unused: $f"; doneContact the Amaranth team or open an issue on GitHub.