Skip to main content
Glama

Compress images

compress_images

Compress, convert or resize images. Send public image addresses in urls, uploads made with create_upload_link in upload_ids, or small files inline as base64 in files. Each image counts one against the account's daily images and compressions a minute, the same as on the website. Images are queued and compress in the background, usually in a few seconds: call get_image with each id until its status is completed, already-optimized, failed or cancelled, then download it from its download_url. Each image also gets an AI alt text and a suggested file name unless alt_text is false; they arrive in alt_text a few seconds after the image is completed or already-optimized. One call takes up to 20 images across urls, upload_ids and files; send the rest in another.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsNoPublic http or https addresses of images to fetch. Iminify refuses private networks, follows up to five redirects and names each file after its address.
filesNoSmall files sent inline, up to 4 MB each. Use create_upload_link for anything bigger.
levelNoHow hard to compress. "smart" (the default) finds the lowest quality that still looks like the original; "ultra" goes further and softens fine texture a little; "lossless" changes no pixel; "none" only converts, resizes and strips metadata.
scaleNoResize to this percentage of the original, 1 to 100. Not together with width or height.
widthNoResize to this width in pixels. Alone, the height follows the aspect ratio; with height too, the image is resized to exactly that size.
formatNoConvert to this format. "auto" encodes every format that can hold the image and keeps the smallest. Leave it out to keep each image's own format (a HEIC or TIFF always comes back in another one).
heightNoResize to this height in pixels, the same way as width.
alt_textNoWrite an alt text and a suggested file name for each image with AI. On by default; false leaves it out. They arrive a few seconds after the image finishes, each counting against the account's daily AI alt texts; once those are used up the images still compress, without one.
upload_idsNoUpload ids from create_upload_link whose file has been sent. Each upload can be compressed once.
keep_metadataNoKeep the EXIF metadata (camera, date, location). Off by default, which strips it; the orientation is applied to the pixels first.
alt_text_languageNoThe language to write the alt text in, as a language tag. English ("en") by default. The suggested file name follows it for languages written in the Latin alphabet and is in English otherwise.
use_suggested_nameNoRename the optimized copy to the suggested file name as soon as the alt text arrives, unless it already has a new name by then. Off by default.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nextNo
imagesNoThe images queued.
refusedNoThe sources refused, each with the reason.
not_startedNoAddresses not fetched because the call ran out of time.
not_started_noteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / alt_text
      Added value: +{
      +  "description": "Write an alt text and a suggested file name for each image with AI. On by default; false leaves it out. They arrive a few seconds after the image finishes, each counting against the account's daily AI alt texts; once those are used up the images still compress, without one.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / alt_text_language
      Added value: +{
      +  "description": "The language to write the alt text in, as a language tag. English (\"en\") by default. The suggested file name follows it for languages written in the Latin alphabet and is in English otherwise.",
      +  "enum": [
      +    "en",
      +    "es",
      +    "fr",
      +    "de",
      +    "it",
      +    "pt",
      +    "nl",
      +    "pl",
      +    "sv",
      +    "tr",
      +    "ru",
      +    "uk",
      +    "ar",
      +    "fa",
      +    "he",
      +    "hi",
      +    "id",
      +    "vi",
      +    "th",
      +    "ja",
      +    "ko",
      +    "zh-Hans",
      +    "zh-Hant"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / use_suggested_name
      Added value: +{
      +  "description": "Rename the optimized copy to the suggested file name as soon as the alt text arrives, unless it already has a new name by then. Off by default.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / images / items / properties / alt_text
      Added value: +{
      +  "description": "The AI alt text, or null when none was asked for.",
      +  "properties": {
      +    "language": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "status": {
      +      "description": "pending: being written, a few seconds after the image is completed or already-optimized; it waits for a retry while the image is failed or cancelled. written: ready. failed: ask again with write_alt_text. skipped: the day's AI alt texts were used up.",
      +      "enum": [
      +        "pending",
      +        "written",
      +        "failed",
      +        "skipped"
      +      ],
      +      "type": "string"
      +    },
      +    "suggested_name": {
      +      "description": "A descriptive file name without an extension, for rename_image.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "text": {
      +      "description": "One sentence for the image's alt attribute, once written.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "text",
      +    "language",
      +    "suggested_name"
      +  ],
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / images / items / required
      Previous value: -[
      -  "id",
      -  "status",
      -  "name",
      -  "original",
      -  "optimized",
      -  "saved_bytes",
      -  "saved_percent",
      -  "settings",
      -  "scan_id",
      -  "source_url",
      -  "share_url",
      -  "created_at",
      -  "updated_at"
      -]New value: +[
      +  "id",
      +  "status",
      +  "name",
      +  "original",
      +  "optimized",
      +  "saved_bytes",
      +  "saved_percent",
      +  "settings",
      +  "alt_text",
      +  "scan_id",
      +  "source_url",
      +  "share_url",
      +  "created_at",
      +  "updated_at"
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / images / items / properties / source_url
      Added value: +{
      +  "description": "The address it was fetched from: its address on the scanned page, or the url it was sent as. Null for a file.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / images / items / required
      Previous value: -[
      -  "id",
      -  "status",
      -  "name",
      -  "original",
      -  "optimized",
      -  "saved_bytes",
      -  "saved_percent",
      -  "settings",
      -  "scan_id",
      -  "share_url",
      -  "created_at",
      -  "updated_at"
      -]New value: +[
      +  "id",
      +  "status",
      +  "name",
      +  "original",
      +  "optimized",
      +  "saved_bytes",
      +  "saved_percent",
      +  "settings",
      +  "scan_id",
      +  "source_url",
      +  "share_url",
      +  "created_at",
      +  "updated_at"
      +]
  3. Changed2 schema fields changed
    • addedOutput schema / properties / images / items / properties / settings / properties / format
      Added value: +{
      +  "description": "The format asked for, or null when none was sent. auto stays auto after the image finishes.",
      +  "enum": [
      +    "auto",
      +    "webp",
      +    "avif",
      +    "png",
      +    "jpg",
      +    null
      +  ],
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / images / items / properties / settings / required
      Previous value: -[
      -  "level",
      -  "keep_metadata",
      -  "width",
      -  "height",
      -  "scale"
      -]New value: +[
      +  "level",
      +  "format",
      +  "keep_metadata",
      +  "width",
      +  "height",
      +  "scale"
      +]
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "images": {
      +      "description": "The images queued.",
      +      "items": {
      +        "properties": {
      +          "created_at": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "hint": {
      +            "description": "What to do next, when the status alone does not say.",
      +            "type": "string"
      +          },
      +          "id": {
      +            "description": "The image's id.",
      +            "type": "string"
      +          },
      +          "name": {
      +            "description": "The name the optimized copy downloads under.",
      +            "type": "string"
      +          },
      +          "optimized": {
      +            "description": "Null until the image has finished.",
      +            "properties": {
      +              "download_url": {
      +                "description": "Works without a token for an hour.",
      +                "type": "string"
      +              },
      +              "format": {
      +                "type": "string"
      +              },
      +              "height": {
      +                "type": "integer"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "size": {
      +                "description": "Bytes.",
      +                "type": "integer"
      +              },
      +              "width": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "format",
      +              "size",
      +              "width",
      +              "height",
      +              "download_url"
      +            ],
      +            "type": [
      +              "object",
      +              "null"
      +            ]
      +          },
      +          "original": {
      +            "properties": {
      +              "download_url": {
      +                "description": "Works without a token for an hour.",
      +                "type": "string"
      +              },
      +              "format": {
      +                "type": "string"
      +              },
      +              "height": {
      +                "type": "integer"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "size": {
      +                "description": "Bytes.",
      +                "type": "integer"
      +              },
      +              "width": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "format",
      +              "size",
      +              "width",
      +              "height",
      +              "download_url"
      +            ],
      +            "type": "object"
      +          },
      +          "saved_bytes": {
      +            "description": "Negative when the optimized copy is larger.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "saved_percent": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "scan_id": {
      +            "description": "The page scan that found it, if one did.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "settings": {
      +            "properties": {
      +              "height": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              },
      +              "keep_metadata": {
      +                "type": "boolean"
      +              },
      +              "level": {
      +                "enum": [
      +                  "none",
      +                  "lossless",
      +                  "ultra",
      +                  "smart",
      +                  null
      +                ],
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "scale": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              },
      +              "width": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "level",
      +              "keep_metadata",
      +              "width",
      +              "height",
      +              "scale"
      +            ],
      +            "type": "object"
      +          },
      +          "share_url": {
      +            "description": "Its public page, once shared.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "status": {
      +            "enum": [
      +              "queued",
      +              "optimizing",
      +              "completed",
      +              "failed",
      +              "already-optimized",
      +              "cancelled"
      +            ],
      +            "type": "string"
      +          },
      +          "updated_at": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "status",
      +          "name",
      +          "original",
      +          "optimized",
      +          "saved_bytes",
      +          "saved_percent",
      +          "settings",
      +          "scan_id",
      +          "share_url",
      +          "created_at",
      +          "updated_at"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "next": {
      +      "type": "string"
      +    },
      +    "not_started": {
      +      "description": "Addresses not fetched because the call ran out of time.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "not_started_note": {
      +      "type": "string"
      +    },
      +    "refused": {
      +      "description": "The sources refused, each with the reason.",
      +      "items": {
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "retry_after": {
      +            "description": "Seconds to wait before sending it again.",
      +            "type": "integer"
      +          },
      +          "source": {
      +            "description": "The address, upload id or file name refused.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "source",
      +          "message",
      +          "code"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  5. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources