Skip to main content

Crop Image

ImageCrop Image

The Crop Image API crops an image by border or rectangle. You send the image as Base64 (docContent), docName, CropType (Border or Rectangle), and for Border: LeftBorder, RightBorder, TopBorder, BottomBorder; for Rectangle: UpperLeftX, UpperLeftY, Width, Height; optionally async. The API returns the cropped image. Use the tester below to try it; more details are in the sections that follow.

Try the Crop Image API

Quick reference

Endpoint: POST /api/v2/CropImage · Required: api-key, docContent, docName, CropType

Try it live

Use the form below to send your API key and image (Base64). Choose Border or Rectangle and set dimensions; the response is the cropped image. No code required—fill the fields and click Send request.

Loading API Tester...

Overview, parameters, and use cases

What is Crop Image?

This endpoint crops an image. You provide the image (Base64), docName, and CropType: Border (LeftBorder, RightBorder, TopBorder, BottomBorder in pixels) or Rectangle (UpperLeftX, UpperLeftY, Width, Height in pixels). The API returns the cropped image.

Key features

  • Border – Crop by specifying left, right, top, and bottom border values in pixels.
  • Rectangle – Crop by specifying upper-left (X, Y) and width/height in pixels.
  • Formats – Supported: JPG, PNG, GIF, BMP, TIFF.
Best for

Use when you need to remove borders or extract a region. Combine with Resize Image or Compress Image in a pipeline.

Prerequisites

Before using this endpoint, make sure you have:

  • A valid PDF4me API key (Get your API Key)
  • An image file (JPG, PNG, GIF, BMP, TIFF) in Base64 format

Response Format

The API returns a cropped image file with the specified crop area applied.

Get Help