Image Optimizer
Verify that all images are under 500 KB and properly compressed/formatted. Use TinyPNG to automatically compress oversized images.
Integrations
This prompt uses requires a TinyPNG API key.
The TinyPNG API is a free API that allows you to compress images. Get your API key at TinyPNG.
Prompt
How it works
Request API key
Request TinyPNG API key from user if not already provided. If unavailable, proceed with audit only and flag images for manual compression.
Get site assets
Use asset_tool with get_all_assets_and_folders action to retrieve all assets from the site.
Get all image assets
Filter assets to identify image files, checking for extensions like .jpg, .jpeg, .png, .webp, .gif, and .svg.
Size analysis
Analyze each image asset’s metadata to identify files exceeding 500 KB. Categorize images as ‘optimized’ (under 500 KB) or ‘needs compression’ (500 KB or larger).