Image Optimization
Image Optimization
This project includes automatic image optimization via a Jekyll plugin to ensure consistent image quality and performance.
Setup
1. Install ImageMagick
The Jekyll image optimizer plugin requires ImageMagick to be installed:
# macOS
brew install imagemagick
# Ubuntu/Debian
sudo apt-get install imagemagick
# Fedora
sudo dnf install ImageMagick
2. That’s it!
The Jekyll plugin will automatically optimize images whenever you build the site:
jekyll serve # Images are optimized during build
# or
jekyll build
Image Optimization
Images are automatically optimized to:
- Width: 900px (max, maintains aspect ratio)
- Quality: 70% JPEG
- Metadata: Stripped (removes EXIF data)
The plugin runs when Jekyll builds, detecting any new or modified images in assets/img/ and optimizing them automatically.
Manual Optimization
If you need to manually optimize all images, you can use the shell script:
# Optimize only new/modified images
./scripts/optimize-images.sh
# Reprocess all images
./scripts/optimize-images.sh --all
Adding New Images
- Add your image to
assets/img/ - Run
jekyll serveorjekyll build - The image is automatically optimized during the build
Current Images
Run this to see your images and their current sizes:
ls -lh assets/img/ | grep -E "\.(jpg|jpeg|png)$"