Convert to APNG
Animated PNG. The API converts 30 formats to APNG. These are the options, by input format.
curl https://api.switchfile.io/v1/convert \
-H "Authorization: Bearer $SWITCHFILE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/input.3g2","to":"apng","options":{"width":1280}}'const res = await fetch("https://api.switchfile.io/v1/convert", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SWITCHFILE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"url":"https://example.com/input.3g2","to":"apng","options":{"width":1280}}),
});
console.log(await res.json());From 30 formats
widthintegerdefault: not setWidth in pixels. Without width and height the result is at most 640 pixels wide.
heightintegerdefault: not setHeight in pixels.
fitenumdefault: max"max" fits inside width and height without enlarging, "crop" fills and crops, "pad" adds bars, "scale" stretches.
one of max, crop, pad, scale
fpsnumberdefault: 12Frames per second.
trim_startstringdefault: not setStart of the part to keep, in seconds or HH:MM:SS.
trim_endstringdefault: not setEnd of the part to keep, in seconds or HH:MM:SS.