Converts an image to a different format (jpeg, png, or webp).
convert(imageID: string, body: ImageConvertParams, options?: RequestOptions): APIPromise<ImageObject>;
Show convertOptions
Show convertOptions
string
required
The unique identifier of the image to convert.
object
required
The body parameters for converting the image.
Show Examples
Show Examples
const imageObject = await client.images.convert('image_etm0g3x5iap4cld1qcfsjvo2', { format: 'jpeg' });
Crops an image by specifying the dimensions of the crop area.
crop(imageID: string, body: ImageCropParams, options?: RequestOptions): APIPromise<ImageObject>;
Show cropOptions
Show cropOptions
string
required
The unique identifier of the image to crop.
object
required
The body parameters for cropping the image.
Show ImageCropParams
Show ImageCropParams
number
required
The x-coordinate of the top-left corner of the crop area.
number
required
The x-coordinate of the bottom-right corner of the crop area.
number
required
The y-coordinate of the top-left corner of the crop area.
number
required
The y-coordinate of the bottom-right corner of the crop area.
string
The name of the image to identify it on the dashboard.
Show Examples
Show Examples
const imageObject = await client.images.crop('image_etm0g3x5iap4cld1qcfsjvo2', { x1: 0, x2: 100, y1: 0, y2: 100 });
Mirrors an image horizontally or vertically.
mirror(imageID: string, body: ImageMirrorParams, options?: RequestOptions): APIPromise<ImageObject>;
Show mirrorOptions
Show mirrorOptions
Show Examples
Show Examples
const imageObject = await client.images.mirror('image_etm0g3x5iap4cld1qcfsjvo2', { mode: 'horizontal' });
Resizes an image, you can use
fit to specify how the image is resized.resize(imageID: string, body: ImageResizeParams | null | undefined = {}, options?: RequestOptions): APIPromise<ImageObject>;
Show resizeOptions
Show resizeOptions
string
required
The unique identifier of the image to resize.
object
The body parameters for resizing the image.
Show ImageResizeParams
Show ImageResizeParams
string
The fit mode to use when resizing the image (cover, contain, or fill).
number
The height of the image to resize.
string
The color of the letterbox when using the contain fit mode.
string
The name of the image to identify it on the dashboard.
string
The gravity position of the image when using the cover or contain fit modes.
number
The width of the image to resize.
Show Examples
Show Examples
const imageObject = await client.images.resize('image_etm0g3x5iap4cld1qcfsjvo2', { width: 200, height: 200 });
Rotates an image by a specified angle.
rotate(imageID: string, body: ImageRotateParams, options?: RequestOptions): APIPromise<ImageObject>;
Show rotateOptions
Show rotateOptions
string
required
The unique identifier of the image to rotate.
Show Examples
Show Examples
const imageObject = await client.images.rotate('image_etm0g3x5iap4cld1qcfsjvo2', { angle: 90 });

