Image Processing
Introduction
Free to use Image Conversion Api. This conversion allow you to apply various filter, resize image, crop image and many other image editing tasks.
Conversion will be applied in same order as passed in request
Endpoint
Post
  https://api.oyyi.xyz/v1/image/convertContent-Type: multipart/form-data
Parameters
file Required
- Type:
File
oruuid
- UUID can be id of previous conversion so that you don't have to re-upload file to server, and it will
save network resource and timing.Max Size Allowed for file is
100MB
by default. If you need more, you ask us to increase it for you. 429 Error will be return otherwise
- Type:
resize
This parameter is required to resize image by width , height parameter. Third parameter to maintain aspect ratio.- Type:
string
- Parameter Format:
width
,height
,aspect_ratio
1 for true
to maintain aspect ratio and0 for false
- Example: -
100,100,1
or100,100,0
- Type:
blur
Needed to blur image by given amount.- Type:
number
between range0
to100
- Parameter Format:
amount
- Example: -
5
- Type:
contrast
Increase or decrease contrast of image by given amount.- Type:
number
- Parameter Format:
-100
and100
- Example:
20
or-5
- Type:
brightness
Increase or decrease brightness of image by given amount.- Type:
number
- Parameter Format:
-100
and100
- Example:
20
or-5
- Type:
crop
Crop the given image by given amount of width height.- Type:
string
- Parameter Format:
width,height,x_position,y_position
default value ofx and y position
is0,0
- Example:
100,100
or120,120,30,50
- Type:
flip
flip the given image horizontally or vertically. .- Type:
string
- Parameter Format:
h
forhorizontal
andv
forvertical
flip - Example:
h
orv
- Type:
gamma
change the gamma value of image by given amount.- Type:
amount
- Parameter Format:
amount
can be anyinteger or decimal
- Example:
3
or5.7
- Type:
greyscale
convert the image in black and white.- Type:
boolean
- Parameter Format:
1
fortrue
and0
forfalse
- Example:
1
or0
- Type:
invert
invert the color of image.- Type:
boolean
- Parameter Format:
1
fortrue
and0
forfalse
- Example:
1
or0
- Type:
opacity
change the gamma value of image by given amount.- Type:
number
- Parameter Format:
amount
between0
to100
- Example:
3
- Type:
pixelate
change the image pixel size by given value.- Type:
number
- Parameter Format:
amount
- Example:
9
- Type:
rotate
rotate the given image by given angel value.- Type:
string
- Parameter Format:
angle,bg_color
angle
can be between-360
to360
bg_color
can be 'hex color'. Default is#000000
- Example:
-40
or-40,#f0f0f0
- Type:
sharp
sharp the given image color by given value.- Type:
number
- Parameter Format:
amount
between0
and100
- Example:
10
- Type:
format
Format for converted image.- Type:
string
- Parameter Format:
format
injpg
jpeg
png
gif
tiff
webp
- Default: format will be same as uploaded image
- Example:
png
orwebp
Be careful while using format and custom converted filename at same time. Converted Filename extension should match the output format , otherwise it might cause unexpected behaviour- Type:
Extra Parameter
Apart from these you can also all available common parameter available for media processing request. See Here
Example
Python
import requestsurl = $BASE_URL/image/converttoken = 'your_bearer_token_here'headers = {'Authorization': f'Bearer {token}'}params = {'resize': '300,200,1', 'rotate': '30'}files = {'file': open('example_file.jpg', 'rb')}response = requests.post(url,params=params, headers=headers, files=files)print(response.text)
Response
Default
{ "data": { "id": "4c27a32a-8d3e-4ad4-a19c-91063cb0483f", "converted_file": "your_random_converted_file.jpg", "created_at": "2023-02-22T06:25:35.659015Z", "status": "done" }}
You can visit here to know to you can fetch file by id.
Table of Contents