Services

Input and output options

Snipshot Services is designed to let outsides sites send users and their images to Snipshot and receive them back again. The benefit to your site comes from the changes your users make to their images in the Snipshot editor. You can help your users meet your needs by specifying input and output options.

Input and output options change the properties of images as they enter and leave Snipshot. For example, setting the input options to {"effect":{"enhance":true}} will enhance every image as it enters Snipshot. Try it out.

As a special feature, if a maximum size is specified on output, as in {"size":{"max":{"width":300,"height":200}}}, users will get a dotted area that indicates the dimensions they have to fit. Try it out.

Options must be submitted in the parameters snipshot_input_options and snipshot_output_options. The values of these parameters are expected to be JSON objects. The list of currently supported options is printed below.

Input options
{
  "adjust": { 
    "brightness": int,
    "contrast": int,
    "hue": int,
    "rotate": int,
    "saturation": int,
    "sharpness": int
  },
  "effect": { 
    "enhance": boolean 
  }
}
Output options
{
  "size": {
    "max": {
      "width": int (pixels),
      "height": int (pixels)
    },
    "min": {
      "width": int (pixels),
      "height": int (pixels)
    }
  },
  "hires": boolean,
  "filename": string,
  "filetype": string (file extension),
  "filesize": int (bytes)
}

Notes

size:min works in conjunction with size:max to re-crop a picture on output.

hires will force the image to be saved at its original resolution minus any cropping. Resizing is ignored. This is good for preserving a high quality copy of the image.

filesize specifies the maximum desired size of the output file. This works only for JPG and is achieved by increasing the level of compression.