Coder Social home page Coder Social logo

go-image-api's Introduction

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

go-image-api's People

Contributors

n9mi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.