Simple RESTful API with Fiber and gocv to upload and perform image processing such as:
- PNG to JPG conversion
- Image resizing with specified dimension
- Image compression while maintaining reasonable quality, with modifiable parameter
- Install gocv locally
- Create Cloudinary account to get API key
- Running postgreSQL locally or using docker for storing image processing histories.
/api/v1/convert-png-to-jpeg
Performs png image to jpeg image conversion, but Cloudinary takes jpeg image into jpg, so the 'result_image_link' may in jpg, not jpeg.
Header
Key |
Value |
Content-Type |
multipart/form-data |
Performs image resizing with provided width and height in pixels. Only accept png, jpg, and jpeg.
Header
Key |
Value |
Content-Type |
multipart/form-data |
Key |
Value |
image |
[file] |
height_in_pixels |
1-3000 |
width_in_pixels |
1-3000 |
Performs image compression with quality parameter (default as 70). Only accept png, jpg, and jpeg.
Header
Key |
Value |
Content-Type |
multipart/form-data |
Key |
Value |
image |
[file] |
compress_quality |
0-99 |
- Accepting images in batches