Actions114
- AI Actions
- AI Advanced OCR
- Check Content Policy
- Detect Adult Content
- Detect Brand
- Detect Color
- Detect Email Type
- Detect Faces
- Enitity Detection
- Extract Contact Information
- Extract Customizable Information From Text
- Fuzzy Text Matcher
- Generate Image
- Generate Javascript Code
- Generate Python Code
- Language Detection
- Mood Detection
- PDF OCR
- Picture Object Recognition
- Picture Text Recognition
- Redact Sensitive Information From PDF
- Too Long To Read
- Transcribe
- Translation
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Image → Crop
AI-generatedOverview
This node operation performs cropping on an image. It supports input images either as a publicly accessible URL or as a buffer. The user can specify the cropping area by defining the top, left, width, and height parameters. Additional options include specifying the axis to crop on, the filename of the image, and whether to get the resulting image as a URL. This operation is useful for scenarios where you need to extract a specific portion of an image, such as focusing on a particular object or area within the image.
Use Case Examples
- Cropping a product image to highlight the product only before displaying it on a website.
- Extracting a face from a group photo by cropping the image around the face area.
- Preparing images for thumbnails by cropping to a fixed size.
Properties
| Name | Meaning |
|---|---|
| Code Variables | Variables defined in the code editor that can be used within the operation, allowing dynamic input values. |
| Type of Data | Specifies whether the input image is provided as a URL or as a buffer. |
| URL | The publicly accessible URL of the image to be cropped. Required if Type of Data is URL. |
| Buffer | The buffer of the image to be cropped. Required if Type of Data is Buffer. |
| Options Cropping | JSON object specifying the cropping rectangle with properties top, left, width, and height. |
| Axis | Axis to crop on, if applicable. |
| File Name | Filename of the image to operate on. |
| Get File as URL | Boolean flag indicating whether to get the resulting cropped image as a URL. |
Output
JSON
croppedImageUrl- URL of the cropped image if 'Get File as URL' is true.croppedImageBuffer- Buffer of the cropped image if 'Get File as URL' is false or buffer input is used.
Dependencies
- An API key credential for the CodeKit API is required to authenticate requests.
Troubleshooting
- Ensure the input image URL is publicly accessible if using URL input type; otherwise, the operation will fail to fetch the image.
- Verify that the cropping options JSON is correctly formatted with valid top, left, width, and height values to avoid errors.
- If using buffer input, ensure the buffer data is correctly encoded and passed to the node.
- Check that the API key credential is valid and has the necessary permissions to perform image operations.