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.
Performs png image to jpeg image conversion, but Cloudinary takes jpeg image into jpg, so the 'result_image_link' may in jpg, not jpeg.
Key | Value |
---|---|
Content-Type | multipart/form-data |
Key | Value |
---|---|
image | [file] |
Key | Value |
---|---|
original_image_link | https://res.cloudinary.com/... |
result_image_link | https://res.cloudinary.com/... |
Performs image resizing with provided width and height in pixels. Only accept png, jpg, and jpeg.
Key | Value |
---|---|
Content-Type | multipart/form-data |
Key | Value |
---|---|
image | [file] |
height_in_pixels | 1-3000 |
width_in_pixels | 1-3000 |
Key | Value |
---|---|
original_image_link | https://res.cloudinary.com/... |
result_image_link | https://res.cloudinary.com/... |
Performs image compression with quality parameter (default as 70). Only accept png, jpg, and jpeg.
Key | Value |
---|---|
Content-Type | multipart/form-data |
Key | Value |
---|---|
image | [file] |
compress_quality | 0-99 |
Key | Value |
---|---|
original_image_link | https://res.cloudinary.com/... |
result_image_link | https://res.cloudinary.com/... |
- Accepting images in batches