Skip to content
Docs menu

Convert to PPM

Portable Pixmap. The API converts 55 formats to PPM. 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":"ppm","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 9 formats

avif, gif, heic, heif, psb, psd, tif, tiff, 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, 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 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.