API: Converting an image to another format

Converts an image of almost any format to either JPEG or PNG.

Request
POST /backend/convert
Account: demo
{
  "input": "eff23c2eccefddd7a782...", 
  "operations": [
    {"type": "auto-orient"}, 
    {
      "color": {"b": 1, "g": 0, "r": 0.3}, 
      "type": "background"
    }, 
    {"colorspace": "RGB", "type": "colorspace"}, 
    {
      "height": 200, 
      "type": "crop", 
      "width": 200, 
      "x": 20, 
      "y": 50
    }, 
    {"dpi": 96, "type": "density"}, 
    {"profile": "da1130fa078a7bf3d9b9...", "type": "profile"}, 
    {"scale": 0.7, "type": "resize"}
  ], 
  "output format": "jpeg", 
  "quality": 0.95
}
input The token of the image to process.
operations The operations to be applied to the image.
output format The desired output format (png, jpeg, webp).
quality The desired output quality from 0 to 1 for jpeg and webp images.
Response
200 OK
{
  "format": {
    "extension": "jpeg", 
    "mimeType": "image/jpeg", 
    "quality": 0.95
  }, 
  "token": "f33608..."
}
token The produced image.
format
The format of the output image:
  • extension: The format extension, e.g. "png".
  • mimeType: The media type of the format, e.g. "image/png".
  • quality: The JPEG compression quality (JPEG pictures only).

CURL example

curl -D - -X POST -H 'Account: demo' --data-binary @convert.json 'https://api.croppola.com/backend/convert'