Skip to content
Docs menu

Convert to GIF

Graphics Interchange Format. The API converts 85 formats to GIF. 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":"gif","options":{"width":1280}}'

From 43 formats

3fr, arw, bmp, cr2, cr3, crw, dcr, dds, dng, erf, exr, hdr, icns, iiq, j2k, jfif, jp2, jpeg, jpg, jxl, kdc, mef, mos, mrw, nef, nrw, orf, pam, pbm, pcx, pef, pgm, png, pnm, ppm, qoi, raf, rw2, rwl, sr2, srf, srw, tga

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

From 30 formats

3g2, 3gp, asf, avi, divx, dv, f4v, flv, ivf, m2ts, m2v, m4v, mkv, mod, mov, mp4, mpeg, mpg, mts, mxf, ogv, rm, rmvb, tod, ts, vob, webm, wmv, wtv, y4m

  • widthintegerdefault: not set

    Width in pixels. Without width and height the result is at most 640 pixels wide.

    1 to 16384 px

  • heightintegerdefault: not set

    Height in pixels.

    1 to 16384 px

  • 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: 12

    Frames per second.

    0.1 to 240 fps

  • trim_startstringdefault: not set

    Start of the part to keep, in seconds or HH:MM:SS.

  • trim_endstringdefault: not set

    End of the part to keep, in seconds or HH:MM:SS.

From 7 formats

avif, heic, heif, psb, psd, tif, tiff

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, 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

cur, ico

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, frames or layers to convert, for example 1-3,5 or all. Without it, the largest icon in the file is converted.

From 2 formats

gif, webp

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pagesstringdefault: not set

    Pages, frames or layers to convert, for example 1-3,5 or all. Without it, all pages or frames are converted.

From SVG

  • widthintegerdefault: not set

    Width of the image in pixels.

    1 to 65535 px

  • heightintegerdefault: not set

    Height 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: false

    Remove metadata such as camera data and location.

  • auto_orientbooleandefault: true

    Rotate the image upright according to its EXIF orientation.

  • pixel_densityintegerdefault: 72

    Resolution in pixels per inch the drawing is rendered at.