games:process-screenshots
Processes and optimizes game screenshots for web display.
Overview
This command processes game screenshots by converting them to optimized WebP format, resizing them for consistent display, and generating thumbnails. It helps improve website performance by reducing image file sizes while maintaining visual quality.
Key Features: WebP conversion, quality optimization, batch processing, memory-efficient handling.
Usage
Options
- --force
Process screenshots even if they already exist.
- --game-id=ID
ID of the specific game to process.
- --game-name=NAME
Name (or part of name) of the game(s) to process.
- --all
Process all visible games with screenshots.
- --quality=QUALITY
WebP quality (0-100) (default: 80).
Processing Logic
The command follows this workflow:
Identifies games with screenshots to process
Downloads original images if not already cached
Converts to WebP format with specified quality
Resizes images to standard dimensions
Generates thumbnails for gallery views
Optimizes file sizes while preserving quality
Updates database records with processed image paths
Examples
Processes screenshots for game ID 123.
Processes with higher quality settings (larger files).
Reprocesses screenshots even if they already exist.
Processes screenshots for all games (may take considerable time).
When to Use
Recommended Usage Scenarios
After importing new games with screenshots
When optimizing website performance
After changing image quality settings
During initial setup or migration
When storage space needs optimization
Image Processing
The command performs several image optimizations:
Format Conversion
WebP Output: Modern format with superior compression
Quality Control: Configurable quality vs. file size balance
Fallback Support: Maintains compatibility with older browsers
Size Optimization
Standard Dimensions: Consistent sizing for layout
Responsive Variants: Multiple sizes for different displays
Thumbnail Generation: Small previews for galleries
Quality Enhancement
Sharpening: Improves clarity after resizing
Color Optimization: Maintains color accuracy
Compression: Reduces file size without visible quality loss
Performance Considerations
Factor | Impact | Mitigation |
|---|---|---|
Memory Usage | High for large images | Process in batches |
Processing Time | Varies by image count | Run during off-peak hours |
Storage Space | Temporary increase during processing | Monitor disk space |
Network Bandwidth | Downloads original images | Consider bandwidth limits |
Quality Settings
Different quality settings provide different trade-offs:
Quality 60-70
Use Case: Maximum compression for bandwidth-limited environments
File Size: Smallest files
Visual Quality: Acceptable for thumbnails
Quality 80 (Default)
Use Case: Balanced compression for general use
File Size: Good compression ratio
Visual Quality: High quality for most purposes
Quality 90-100
Use Case: Maximum quality for detailed screenshots
File Size: Larger files
Visual Quality: Excellent for detailed viewing
Error Handling
The command handles various error conditions:
Download Failures: Retry logic for network issues
Invalid Images: Skip corrupted or unsupported files
Processing Errors: Continue with remaining images
Storage Issues: Handle disk space and permission problems
Output Formats
The processing generates multiple image variants:
Full Size Images
Format: WebP with specified quality
Dimensions: Optimized for detail viewing
Use: Game detail pages and lightboxes
Medium Images
Format: WebP with balanced compression
Dimensions: Suitable for gallery displays
Use: Screenshot galleries and previews
Thumbnails
Format: WebP with higher compression
Dimensions: Small previews
Use: Game cards and quick previews
Storage Organization
Processed images are organized efficiently:
Related Commands
games:process-thumbnails - Process game thumbnails
games:refresh - Download new screenshots for processing