Skip to main content

Image processing

So now we have requred heades set from previous article now we can do image processings

Direct Request

The endpoint for direct image processing https://api.pritset.com/api/image/process/direct/{ops}

Webhook Request

The endpoint for webhook image processing https://api.pritset.com/api/image/process/webhook/{ops}

After request you will receive json object with id of furthure result identification

{ 
id: '57056f7462084dde8902421e9287ea2d'
}

Webhook call

After image processing finish, your Url endpoint will be called with POST request

ParameterValue
BodyProcessed image
Query IdUnique id which was responded by server with processing request (aka '57056f7462084dde8902421e9287ea2d')

Common parameters

ParameterValue
opsThese are parameter from here

Body

Content type of request must be multipart/form-data

ParameterValue
file (required for direct, webhook)This must be a image file you want to adjust
url (required for webhook)Url to your endpoint which will be called after processing

Image adjust params

Resize

/rs:w:h

ParameterDescription
rsResize
wWidth an integer
hHeights an integer

Rotate

/rot:angle

ParameterDescription
rotRotate
angleCan use 0, 90, 180, 270

Crop

/c:w:h/g

ParameterDescription
cCrop
wWidth an integer > 1
hHeights an integer > 1
gGravity Optional param

Gravity

/g:sp:xo:yo

ParameterDescription
gGravity
spStart point
no: north (top edge)
so: south (bottom edge)
ea: east (right edge)
we: west (left edge)
noea: north-east (top-right corner)
nowe: north-west (top-left corner)
soea: south-east (bottom-right corner)
sowe: south-west (bottom-left corner)
ce: center
x, yX and Y offset

Parameters for converting image

/@format

ParameterDescription
formatFrom Supported converting formats in table below

Supported converting formats

FormatExtensionSourceResult
PNGpngYesYes
JPEGjpgYesYes
WebPwebpYesYes
AVIFavifYesYes
GIFgifYesYes
ICOicoYesYes
BMPbmpYesYes
TIFFtiffYesYes