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