Batch Image Processing
Serving Images

As soon as your storage is set up, you can start serving images with SlashedCloud

service_id : number
Required

Your service ID, which is a unique identifier for the service you are using. It's essential to include this in your request so that the server knows which service you are accessing.

callback : string

This is the callback URL. After the server processes your batch request and completes the specified transformations, it will send the response back to this URL.

source : string
Required

The source file that you want to transform. The source file must be in the storage that you have set up.

  • This is an array of jobs to be applied to the source file - In this example we have a transformation.

Example Request
		{
  "service_id": 1,
  "source": "/480x360/1.jpg",
  "jobs": [
    {
      "destination": "/480x360/transformed/1.jpg",
      "quality": 70,
      "transformations": [
        {
          "type": "annotation",
          "font": "Arial",
          "color": "#000000",
          "text": "Test text",
          "size": 10,
          "gravity": "center"
        }
      ]
    }
  ]
}
	

Applying Parameters

We'll demonstrate a good basic set to use, and you can see the full range of what's available in the Rendering API documentation.

Resizing

		{
  "transformations": [
    {
      "width": "500",
      "height": "300",
      "type": "resize"
    }
  ]
}
	

Resizing

Cropping

		{
  "transformations": [
    {
      "type": "crop",
      "gravity": "center",
      "height": "800",
      "width": "500",
      "xoffset": "200",
      "yoffset": "100",
      "fit": "crop"
    }
  ]
}
	

Cropping

Brightness

		{
  "transformations": [
    {
      "type": "brightness",
      "bright_level": "230"
    }
  ]
}
	

Brightness

This was a very brief example of what parameters we're prepared to receive, for the full documentation read the Image Processing API.