Ferramentas de imagem
Crop Image
crop-image
Use Crop Image through the Zavilo SDK. Check input limits, parameters, output and supported modes below.
H · HeadlessI · Interactive
Ações rápidas
Arquivos de entrada 1Arquivos de saída 1
Entrada
Formatos de entrada e quantidade de arquivos aceitos por esta Tool.
| Tipo de entrada | file |
|---|---|
| N.º de arquivos | 1 – 1 |
| MIME aceitos | image/jpeg, image/png, image/webp |
Parâmetros
Passe estes valores por request.options.
| Parâmetro | Tipo | Obrigatório | Padrão | Valores / Faixa | Descrição |
|---|---|---|---|---|---|
x |
integer | Obrigatório | — | 0 – 16383 | Crop left coordinate in source-image pixels. |
y |
integer | Obrigatório | — | 0 – 16383 | Crop top coordinate in source-image pixels. |
width |
integer | Obrigatório | — | 1 – 16384 | Crop width in pixels. |
height |
integer | Obrigatório | — | 1 – 16384 | Crop height in pixels. |
format |
enum | Opcional | original |
original | jpg | png | webp | Output image format. |
quality |
number | Opcional | 0.92 |
0.5 – 1 | Output quality from 0.5 to 1.0. |
Saída
Formato do resultado retornado após o processamento.
| Tipo | files |
|---|---|
| N.º de arquivos | 1 – 1 |
| MIME de saída | image/jpeg, image/png, image/webp |
| Metadata | width, height, inputBytes, outputBytes |
| Arquivo ZIP | Não suportado |
Uso básico
Escolha um modo suportado e copie o código inicial gerado.
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.