Convert to ICO
Windows Icon. The API converts 55 formats to ICO. 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.3fr","to":"ico","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.3fr","to":"ico","options":{"width":1280}}),
});
console.log(await res.json());From 43 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
From 9 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pagesstringdefault: not setPages, frames or layers to convert, for example 1-3,5 or all. Without it, only the first page, frame or layer is converted.
From 2 formats
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pagesstringdefault: not setPages, frames or layers to convert, for example 1-3,5 or all. Without it, the largest icon in the file is converted.
From SVG
widthintegerdefault: not setWidth of the image in pixels.
1 to 65535 px
heightintegerdefault: not setHeight of the image in pixels.
1 to 65535 px
fitenumdefault: max"max" fits inside width and height without enlarging, "upscale" may enlarge, "crop" fills and crops, "scale" stretches to the exact size.
one of max, upscale, crop, scale
stripbooleandefault: falseRemove metadata such as camera data and location.
auto_orientbooleandefault: trueRotate the image upright according to its EXIF orientation.
pixel_densityintegerdefault: 72Resolution in pixels per inch the drawing is rendered at.