Outils image
Crop Image
crop-image
Use Crop Image through the Zavilo SDK. Check input limits, parameters, output and supported modes below.
H · HeadlessI · Interactive
Accès rapide
Fichiers d’entrée 1Fichiers de sortie 1
Entrée
Formats d’entrée et nombre de fichiers acceptés par cette Tool.
| Type d’entrée | file |
|---|---|
| Nombre de fichiers | 1 – 1 |
| MIME acceptés | image/jpeg, image/png, image/webp |
Paramètres
Transmettez ces valeurs via request.options.
| Paramètre | Type | Obligatoire | Par défaut | Valeurs / Plage | Description |
|---|---|---|---|---|---|
x |
integer | Obligatoire | — | 0 – 16383 | Crop left coordinate in source-image pixels. |
y |
integer | Obligatoire | — | 0 – 16383 | Crop top coordinate in source-image pixels. |
width |
integer | Obligatoire | — | 1 – 16384 | Crop width in pixels. |
height |
integer | Obligatoire | — | 1 – 16384 | Crop height in pixels. |
format |
enum | Optionnel | original |
original | jpg | png | webp | Output image format. |
quality |
number | Optionnel | 0.92 |
0.5 – 1 | Output quality from 0.5 to 1.0. |
Sortie
Format du résultat renvoyé après traitement.
| Type | files |
|---|---|
| Nombre de fichiers | 1 – 1 |
| MIME de sortie | image/jpeg, image/png, image/webp |
| Metadata | width, height, inputBytes, outputBytes |
| Archive ZIP | Non pris en charge |
Utilisation de base
Choisissez un mode pris en charge et copiez le code de démarrage généré.
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.