1. Tasks
  2. Manipulate Image

Tasks

Manipulate Image

This task manipulates images by performing operations such as rotation, cropping, resizing, quality adjustment, and grayscale conversion.

Use Cases

  • Rotating images that are not oriented correctly to allow for better LLM understanding.
  • Reducing image quality to reduce image filesize and optimize storage.
  • Cropping images to focus on specific regions of interest.
  • Resizing images to meet specific dimension requirements.
  • Converting images to grayscale for document processing or analysis.

Basic usage

loading...

Parameters

files
required
object[]

An array of file objects. Each object contains file metadata.

Show child attributes
fileuuid
required
string

The unique identifier of the image file that should be manipulated.


operations
required
object

An object containing the manipulation operations to perform on the image. You can specify one or more operations. Available operations:

Show child attributes

crop

optional
object

Crops the image to specified dimensions and offset.

  • width
    number
    - Width of the cropped area in pixels
  • height
    number
    - Height of the cropped area in pixels
  • x_offset
    number
    - Horizontal offset from the top-left corner in pixels
  • y_offset
    number
    - Vertical offset from the top-left corner in pixels

rotate

optional
object

Rotates the image by the specified degrees.

  • degrees
    number
    - Rotation angle in degrees (e.g., 90, 180, 270)

resize

optional
object

Resizes the image to specified dimensions.

  • width
    number
    - New width in pixels
  • height
    number
    - New height in pixels

adjust_quality

optional
object

Adjusts the image quality/compression level.

  • quality
    number
    - Quality level from 1-100, where 100 is highest quality

grayscale

optional
boolean

Converts the image to grayscale when set to true.


Result

loading...

Properties

images
array

An array of file objects representing the manipulated images. Each object contains:

  • filename
    string
    - The filename of the manipulated image
  • originalname
    string
    - The original filename
  • fileuuid
    string
    - The unique identifier of the manipulated image file
  • contentType
    string
    - The MIME type of the image

Examples

Rotate an image 90 degrees

Rotates an uploaded image 90 degrees clockwise.

loading...

Reduce image quality for optimization

Reduces the image quality to 50% to decrease file size.

loading...

Crop and resize an image

Crops a specific region from an image and then resizes it.

loading...

Convert to grayscale for document processing

Converts an image to grayscale and reduces quality for document processing workflows.

loading...

Multiple operations on an image

Applies multiple manipulation operations: rotation, cropping, resizing, quality adjustment, and grayscale conversion.

loading...