Analyse images
analyze_imagesScan files, folders, or globs to report image format, size, dimensions, transparency, and animation, and optionally classify images and preview optimization plans.
Instructions
Scan files, folders or globs and report what is there: format, size, dimensions, transparency, animation. With deep: true, also classify each image (photo, screenshot, graphic, icon, animated) and show the plan optimize_images would follow (candidate formats, sizes, quality target, output path). Read-only. Paged: use offset/nextOffset. Allowed directories: (none configured).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crop | No | Exact output shape (e.g. 400x400 thumbnails). attention keeps faces/salient areas; entropy keeps the busiest area. | |
| deep | No | Decode and classify each image (photo/screenshot/graphic/icon/animated) and show the plan. Slower; at most 50 per call. | |
| limit | No | ||
| paths | Yes | Files, folders or globs (e.g. "site/public/**/*.png") inside the allowed directories. | |
| offset | No | ||
| policy | No | auto (default): WebP (lossy, lossless or palette, whichever is smallest at the target); works in every current browser. avif: AVIF or WebP, whichever is smaller (often 20–30% smaller photos; AVIF needs Safari 16.4+). keep: same format as the source. picture: AVIF/WebP plus a JPEG/PNG fallback for <picture>. | |
| resize | No | Fit inside this box, keeping the aspect ratio. Never upscales. | |
| target | No | Visual-quality target (SSIMULACRA 2). Presets for photos: small=65, balanced=75 (default), high=85, lossless-look=90; screenshots, graphics and icons get +10 (faint UI lines need it). Or an exact number 30–100 for every image. | |
| widths | No | Responsive widths for srcset. "auto" = 640/960/1280/1920/2560 up to the image's own width. Files get a -<w>w suffix. | |
| metadata | No | strip (default): remove EXIF/GPS/XMP after auto-rotating. all: keep metadata. | |
| priority | No | Markup only: above-the-fold image (loading="eager", fetchpriority="high"). | |
| recursive | No |