Bild-Tools
Compress Image
compress-image
Use Compress Image through the Zavilo SDK. Check input limits, parameters, output and supported modes below.
H · Headless
Schnellzugriff
Eingabedateien 1Ausgabedateien 1
Eingabe
Zulässige Eingabeformate und Dateianzahl für dieses Tool.
| Eingabetyp | file |
|---|---|
| Dateianzahl | 1 – 1 |
| Zulässige MIME-Typen | image/jpeg, image/png, image/webp |
Parameter
Diese Werte über request.options übergeben.
| Parameter | Typ | Erforderlich | Standard | Zulässig / Bereich | Beschreibung |
|---|---|---|---|---|---|
format |
enum | Optional | auto |
auto | jpg | webp | Output format. auto uses WebP for WebP input and JPG for other supported inputs. |
quality |
number | Optional | 0.8 |
0.3 – 0.95 | Compression quality from 0.3 to 0.95. |
Ausgabe
Nach erfolgreicher Verarbeitung zurückgegebenes Ergebnisformat.
| Typ | files |
|---|---|
| Dateianzahl | 1 – 1 |
| Ausgabe-MIME | image/jpeg, image/webp |
| Metadata | width, height, inputBytes, outputBytes |
| ZIP-Archiv | Nicht unterstützt |
Grundlegende Verwendung
Unterstützten Integrationsmodus wählen und den erzeugten Starter-Code kopieren.
Headless
const result = await client.run("compress-image", {
file,
options: { format: "auto", quality: 0.8 }
});
console.log(result.files, result.data, result.metadata);
Embedded
await client.mount({ tool: "compress-image", target: "#zavilo-tool", mode: "embedded" });
This page is generated from the SDK Tool Definition used by the runtime.