---
updatedAt: 2026-02-09T05:32:13.000Z
agentTools:
  projectIndex: https://docs.embed.ly/llms.txt
---

# /1/display/crop

Crop an image to fill the given dimensions.

Crop an image to fill the given dimensions. The image will first be resized to it’s smallest possible size that will fill the entire given dimensions, preserving it’s aspect ratio. The image is then centered within the given dimensions, and any part of the image that doesn’t fit is removed. The same amount is trimmed from each side of the image in the cropping dimension.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "iembedly",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://i.embed.ly"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "key",
        "in": "query",
        "x-default": ""
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/1/display/crop": {
      "get": {
        "summary": "/1/display/crop",
        "description": "Crop an image to fill the given dimensions.",
        "operationId": "crop",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "The URL of the image to proxy. The URL must be url-encoded to ensure that Embedly retrieves the correct link.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "key",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Your Embedly API key."
          },
          {
            "name": "width",
            "in": "query",
            "description": "The width that the image should fill.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "height",
            "in": "query",
            "description": "The height that the image should fill.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "errorurl",
            "in": "query",
            "description": "The URL of the fall back image to use when url fails. The URL must be url-encoded to ensure that Embedly retrieves the correct link.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grow",
            "in": "query",
            "description": "Set to true if growing the image is allowed. Otherwise the image will never expand beyond it’s original dimensions, making width and height behave like max width and max height.",
            "schema": {
              "type": "boolean",
              "default": "false"
            }
          },
          {
            "name": "animate",
            "in": "query",
            "description": "Setting animate to false will convert the image to the first frame of animation for animated images. Setting this value on non-animated images will have non effect and is safe to do.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "compresspng",
            "in": "query",
            "description": "Setting to true utilizes palette quantization, and increases response time. Setting to false is lossless, zlib compression",
            "schema": {
              "type": "boolean",
              "default": "true"
            }
          },
          {
            "name": "quality",
            "in": "query",
            "description": "Output quality for JPEG/WebP (1-100). Higher = better quality, larger file.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": "85"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {}
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```