Skip to main content

Image processing

So now we have access_token from previous article we should add it to the request headers and we can do image processings

Request

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

ParameterValue
opsThese are parameter from here

Headers

ParameterValue
AuthorizationBearer {access_token}
X-Application-KeyKey from application overview

Body

ParameterValue
file (required)This must be a image file you want to adjust

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