すべての Tool›Crop Image
画像ツール

Crop Image

crop-image

Use Crop Image through the Zavilo SDK. Check input limits, parameters, output and supported modes below.

H · HeadlessI · InteractiveE · Embedded
Tool IDcrop-image
バージョン1
実行方式CLIENT
対応モードHeadless, Interactive, Embedded

クイック操作

入力ファイル 1出力ファイル 1

入力

この Tool が受け付ける入力形式とファイル数です。

入力種類file
ファイル数1 – 1
対応 MIMEimage/jpeg, image/png, image/webp

パラメータ

これらの値は request.options で渡します。

パラメータ 型 必須 既定値 許可値 / 範囲 説明
x integer 必須 — 0 – 16383 Crop left coordinate in source-image pixels.
y integer 必須 — 0 – 16383 Crop top coordinate in source-image pixels.
width integer 必須 — 1 – 16384 Crop width in pixels.
height integer 必須 — 1 – 16384 Crop height in pixels.
format enum 任意 original original | jpg | png | webp Output image format.
quality number 任意 0.92 0.5 – 1 Output quality from 0.5 to 1.0.

出力

処理完了後に返される結果形式です。

型files
ファイル数1 – 1
出力 MIMEimage/jpeg, image/png, image/webp
Metadatawidth, height, inputBytes, outputBytes
ZIP アーカイブ非対応

基本例

対応する統合モードを確認し、生成された開始コードをコピーできます。

Headless

const result = await client.run("crop-image", {
  file,
  options: { x: 0, y: 0, width: 1, height: 1 }
});
console.log(result.files, result.data, result.metadata);

Interactive

await client.open({
  tool: "crop-image",
  input: { file },
  options: { x: 0, y: 0, width: 1, height: 1 },
  onComplete(result) { console.log(result.files, result.data, result.metadata); }
});

Embedded

await client.mount({ tool: "crop-image", target: "#zavilo-tool", mode: "embedded" });
This page is generated from the SDK Tool Definition used by the runtime.