Skip to content

RESTful API to process images with GoCV and Fiber

Notifications You must be signed in to change notification settings

n9mi/go-image-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-image-api-v1

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

Prerequisites

  1. Install gocv locally
  2. Create Cloudinary account to get API key
  3. 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

Request

Key Value
image [file]

Response

Key Value
original_image_link https://res.cloudinary.com/...
result_image_link https://res.cloudinary.com/...

/api/v1/image-resize

Performs image resizing with provided width and height in pixels. Only accept png, jpg, and jpeg.

Header

Key Value
Content-Type multipart/form-data

Request

Key Value
image [file]
height_in_pixels 1-3000
width_in_pixels 1-3000

Response

Key Value
original_image_link https://res.cloudinary.com/...
result_image_link https://res.cloudinary.com/...

/api/v1/image-compress

Performs image compression with quality parameter (default as 70). Only accept png, jpg, and jpeg.

Header

Key Value
Content-Type multipart/form-data

Request

Key Value
image [file]
compress_quality 0-99

Response

Key Value
original_image_link https://res.cloudinary.com/...
result_image_link https://res.cloudinary.com/...

TODO

  • Accepting images in batches

About

RESTful API to process images with GoCV and Fiber

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages